Working on some legacy codes - what is the c# class with black arrow overlay
icon in visual studio 2010 and why it appears?
It means that you have a link to an existing item.
This technique is used when you want to share code.
When you edit the file with the described Icon, it also changes the source where it has been linked from.
Edit: To create a link to an existing item: (taken from MSDN)
In Solution Explorer, select the target project.
On the Project menu, select Add Existing Item.
In the Add Existing Item dialog box, locate and select the project item you want to link.
From the Add button drop-down list, select Add As Link.
i'm trying to use the functionality of the visual studio 2015 to create a project template.
I have a simple wcf-project with my special web.config. To use classes from another project i referenced it.
Those two projects are in the same solution and inherited in source control.
when i create the template and try to add a new project to the same solution, choose my custom template, the solution gets checked out but the files doens't get added to source control.
The source control says, that the binding is invalid. I dont know why.
Does anyone have any suggestions?
Thanks in advance!
Visual studio 2015 - Solution Explorer, Click Show all files,Check new file show in project tree. Right click on file select add to Project. New file need to add .sln (Project solution file) to show in project.
The project template gets added to project tree, but there no "+" sign in front of the file icons. and the solution file is checked out but no changes are made.
I want to import an enum class (.cs) into my project that is generated by another service. So if that service will update this file, it should be automatically updated in my project. It has to be text-only (so I can't use an assembly) because we can't compile code in php.
And here is why I want this:
We are using global language strings in multiple applications and I would like to use them as enumerations for some reasons. When new texts are added I want to be able to use them without copying or changing anything. Maybe there is another way to achieve this.
Thank you.
You can add a source code file to a project as a link.
To do so:
Right-click project and select "Add -> Existing Item"
Navigate to the file you want to add as a link, and select it.
Look at the "Add" button at lower right of the "Add Existing Item" dialog. It has a little drop arrow. Click that drop arrow.
Select "Add as link".
Follow the setps:
Right click on the project go to Add
Select Existing Item
Select the file
On the Add button click the drop down button and select "Add as a Link"
Lets say I want to add a csv file to a project.
Right click on the directory in which you want to add.
Click on ADD and then Existing Item
Click on Add/Add as link , also if you are dealing with csv files or files which don't have convention extensions select All Files in that case.
When I am compiling my .csproj file using .NET Framework 4.0 MSBUILD.EXE file, I am getting an error: "lable01" not found in the current context of "website01.csproj".
Actually, I need to add every ASP.NET page with its code-behind file's reference. I've done it, it's working fine, but the above error is pending.
I hope it means that I need to add form name "LABLE01" in that .csproj file, but I do not know the syntax. Anybody please do provide me with the syntax to add form name in .csproj file.
The CSPROJ file, saved in XML format, stores all the references for your project including your compilation options. There is also an SLN file, which stores information about projects that make up your solution.
If you are using Visual Studio and you have the need to view or edit your CSPROJ file, while in Visual Studio, you can do so by following these simple steps:
Right-click on your project in solution explorer and select Unload Project
Right-click on the project (tagged as unavailable in solution explorer) and click "Edit yourproj.csproj". This will open up your CSPROJ file for editing.
After making the changes you want, save, and close the file. Right-click again on the node and choose Reload Project when done.
Since the question is not directly mentioning Visual Studio, I will post how to do this in JetBrains Rider.
From context menu
Right-click your project
Go to edit
Edit '{project-name.csproj}'
With shortcut
Select project
Press F4
You can right click the project file, select "Unload project" then you can open the file directly for editing by selecting "Edit project name.csproj".
You will have to load the project back after you have saved your changes in order for it to compile.
See How to: Unload and Reload Projects on MSDN.
Since project files are XML files, you can also simply edit them using any text editor that supports Unicode (notepad, notepad++ etc...)
However, I would be very reluctant to edit these files by hand - use the Solution explorer for this if at all possible. If you have errors and you know how to fix them manually, go ahead, but be aware that you can completely ruin the project file if you don't know exactly what you are doing.
There is an easier way so you don't have to unload the project. Just install this tool called EditProj in Visual Studio:
https://marketplace.visualstudio.com/items?itemName=EdMunoz.EditProj
Then right click edit you will have a new menu item Edit Project File :)
in vs 2019 Version 16.8.2
right click on you project name
and click on "Edit Project File"
Here is my option to Edit the project file without the need to Unload the project:
Open Solution Explorer and switch to folder view:
Navigate to the Project which you want to edit inside the Solution folders and right-click on it.
Choose Open from the Context Menu.
That is it!
You will see the *.csproj file opened inside Visual Studio Editor.
After you can switch back to a Solution/Project view (see step 1).
Update:
Starting from the Visual Studio 2019 (v. 16) you can edit the *.csproj file by double-clicking on the Project, just make sure that you have the option turned On from the settings.
For JetBrains Rider:
First Option
Unload Project
Double click the unloaded project
Second option:
Click on the project
Press F4
That's it!
Sorry, most efficient way with out stuffing your proj file is.
right click the file.
goto properties
where Build Action option is set it to NONE.
Do a build (yes you may get build error if you do even better)
go back to properties of that file
set Build Action option is set it back to Compile.
rebuild.
Congratulate your self for being smarter than everyone else and not ****ing you project. For me this exercise took under 10 seconds. Where as manually trying to input the compile... line into the csproj not only can render your project unusable but it is also impossible to maintain on large scale application. Better to keep source version control software to do the updates. If you need to cross merge branches then doing the above is amazing :).
To open the .csproj file:
open the solution explorer
1
Click on the Edit Project File option
2
You can also open the .csproj by double-clicking on the project file. So no need to right click and select edit project file. Just double click and that is it.
It is a built-in option .Net core and .Net standard projects
For Visual Studio-version: 8.1.5,
Right click on the project folder.
Click "Tools", then "Edit File".
A little late to the conversation but I found a better option.
In rider you can enable "open project files with single click"
Just go to the solution options menu and then click in open project files with single click
This may be a ridiculous question for you C# pros but here I go. I'm a Flash developer getting started in Silverlight and I'm trying to figure out how to create a "codebase" (a reusable set of classes) for animation. I'd like to store it in a single location and reuse it across a bunch of different projects. Normally in Flash I would add a "project path" reference and then start using the code. My question is, how do I add a folder to visual studio so that I can "use" those classes in my project. I tried "Add > Existing Item" but that copied the files into my project directory.
The easiest way would to create a new ClassLibrary project and build it. This will output a .dll file in a folder you can specify in the project settings menus, which you reference from every project that needs it.
Also, you can copy this .dll into the /bin/ folder of your project - this will do the same thing for this specific project, but when you start the next one you can change some details in the codebase library without breaking the first project.
The solution described by Tomas (adding a reference to a dll binary) is the correct solution to this problem; better than referencing the source code and compiling it into each project.
But just for extra information, if you ever do need to add a source code file to your Visual Studio project without having it make a copy of the file you can use the following steps:
Right click on your project in Solution Explorer and select Add -> Existing Item.
Navigate to the location of the source code file and select it.
On the "Add" button in the dialog window there is a drop down arrow. Click this and select "Add as Link".
This will allow you to use this source code file in your project without having VS make a copy of the file.
In Solution Explorer, right-click on the project node and click Add Reference.
In the Add Reference dialog box, select the tab indicating the type of component you want to reference. (for instance for a class library a dll)
Select the components you want to reference, then click OK.