Empty list in visual studio references - visual-studio

I am trying to add a reference and there is no signal reference in the list. It's empty. Also I cannot click browse to add a reference.
Any help? So the list is empty without any references:
Thanks

One solution:
File / New / Project select Win32 Console Application and under Solution select Add Solution:
(image) and click ok. Then click next, clear the Precompiled header checkbox and Finish. Once this project is added to your solution, you will be able to right-click References (under your original project) and see the last project you added available under Projects > Solution.
link:
https://msdn.microsoft.com/en-us/library/ms235627.aspx

Related

whats is this icon in visual studio source control? [duplicate]

What does this dotted file icon mean? It's a .cs file but it is not behaving right in my project and I've noticed this separate icon in Solution Explorer:
I've checked the MSDN Documentation in three places
Another page at MSDN
Yet another page at MSDN
I've also checked the Visual Studio Documentation itself, which is rather obscurely organized.
I've even checked this website:
Lastly, I found this topic with a similar question but both the question page and the references inside do not have this icon. Thanks for your help.
This means that the file isn't included in the project.
You're only seeing it because you turned on Show All Files.
You should right-click the file and click Include in Project.
You have "Show all files" checked.
The dotted lines indicate files that have not been added to your project.
Right click on the file and click "Include in project" to include the file in your project.
That "dotted" icon mean that that file is not a part of your project or it is hidden and it is not included in your project.
That "dotted" icon is pretty similar to the icon in Solution Explorer called "Show all files". When you click on it you can see all the files and maybe you click on it or you have some issue and your file is not included in the project.
To include it you can right click one of those files go to Include In Project and that will add it to the project, which declares it in the manifest of your project. You can do it like this:
It is not included in your project and/or hidden.

How do I remove files added as link from my project on Visual Studio?

Inside a solution I'm building with Visual Studio 2019, I have a project for a console application. Inside of this project there are references to other files in different solutions, added with the:
Right click on the project → Add → Reference → Existing items → Add as link
option. I'm afraid that using the Remove option (right click on the files) will also delete the original files since I know that adding a file as link will make it as if the two files were literally the same file. How can I remove these references from the project without deleting the original files from the other solutions?
First of all, you could just delete a link with delete, if it's a link it won't delete the original file. (right click, or press delete on the selected file in the solution explorer)
You could see if it's linked by it's icon:
If you really like to do it manually, then you could edit the csproj file and remove the file with the Link attribute, e.g. remove this line:
<Compile Include="somewhere\MyClass.cs" Link="MyClass.cs" />
I'm afraid that using the Remove option (right click on the files) will also delete the original files
Sounds you need a version control system ;)

How To View the Project > References Tab and All DLL Paths in non-VB projects?

When you create a VB project in Visual Studio there is a 'References' tab in the Project Properties window. It looks like this:
It's rather a helpful window as it shows the paths to all the referenced DLLs in one place and lets you add and remove references easily.
However this same tab does not appear for projects in other languages making it very difficult to check the path for each referenced DLL.
Can this tab be made viewable or available for other projects? If not, what is the simplest way to view all the referenced DLL paths at once?
Unfortunately the reference tab for the other languages does not exist.
But you can try to edit the xml project, with these steps:
Show the context menu on your project in the window solution explorer
Select: Unload project
Right click and select Edit
Edit the ProjectReference element in xml file
Save and close xml
Reload Project (right click in solution explorer)
I know this is not what you wanted, but it could be a quick alternative to display the path of your references.

Error while removing project dependency in VS2010

I have a large solution with number of projects.
Some the projects depend on others (never a circular dependency though).
When I tried to remove a dependency of a project, I am getting an error message like "The dependency was added by the project system and cannot be removed". What is the cause for this error? How I can solve this?
I sometimes get this problem when I try to manually edit projects/solutions generated by our CMake system. I solve it manually:
Open the dependent .vcproj file in your favorite text editor.
Find <ProjectReference> tag corresponding to the dependency you want to remove (the include attribute of the tag will contain the name of the dependency project).
Remove the whole <ProjectReference> element (i.e. starting with <ProjectReference> and ending with </ProjectReference> inclusive). Save the file.
Reload the solution.
I faced the same issue. But i could solve it by following
Right click project, select Properties.
Select Framework and References under Common Properties
Select the references thats not needed.
Click on Remove Reference.
Or =>
To remove a reference in Visual C#:
In Solution Explorer, open the References node under the project
node.
Right-click a reference and click Remove
To remove a reference in Visual Basic:
In Solution Explorer, right-click the My Project node for the
project and select Properties.
Click the References tab.
In the References list, select the reference you want to remove.
Click the Remove button
For Visual Studio 2013:
On C++ projects (hope the same for others too)
From the Solution Explorer, select the project and right click to select the properties
In the properties window, on left pane, select Common properties => References
Right side of the window, you have the option to Add or Remove the other dependency items.
Then select OK, to save
If your project only has the .sln file but not any .csproj, you may want to
check the ProjectReferences property and remove the reference project there
remove the section from Project to EndProject
also remove the related rows under GlobalSection(ProjectConfigurationPlatforms)
As an additional point to #malenkiy_scot's above, for ProjectReference items you want to keep, double check the project guid is the correct one for that project. In the dependent .vcproj file, find the ProjectReference tags as above, and for each you want to keep:
open the referenced project's .vcproj file in a text editor
find its guid in the ProjectGuid tag
compare this with Project tag for that reference in the dependent .vcproj file (not case sensitive)
if it's not the same, replace the guid in the Project tag with the one from the referenced project's ProjectGuid tag
save the project file and reload the solution
Visual Studio uses the project guid rather than name to determine dependencies. So if you've hand edited the name of the dependency but not the guid (as I did) you get the error.
In VS17 Right-clicking on the References node then selecting OptimiseReferences... is good for helping work out your dependencies. Also Right-click on the project and clicking BuildDependancies... ProjectDependencies that might be where your dependency is being set.
1- RIght click References of the project and click Add Reference...
2- Uncheck dependent projects from the solution tab
In the solution explorer window, right click on the project and
select "Edit project file". The project.csproj file would open in the editor.
Find the which nests the tag.
Delete the entire (along with the closing tag).

Strange "go to sources" behaviour in VS

This is what I get when I select "go to definition" in the ConfigTests.cs. But I expected to go to already opened Config.cs with actual declaration.
What did I do wrong?
You added a normal assembly reference.
When you Go to Definition on a member not defined in your project (or in Project References), Visual Studio will generate a source file from metadata using Reflection.
Delete the reference, then re-add it as a Project reference (in the Projects tab).
If the project isn't in the same solution, put it there.
This seems to indicate that your reference to the Models assembly is via the compiled DLL, not via the project in the solution. Try the following in the Solution Explorer:
Expand (unfold) the “References” item of the main project in your solution.
Select “Models” and press Delete to remove it.
Right-click on “References” and choose “Add Reference”.
Select the Projects tab (not the Browse tab).
Highlight the Models project and click OK.
Of course, this assumes that the Models project is in your solution to begin with. If it isn’t, you will first have to add it by right-clicking the first item in the Solution Explorer (the Solution itself), choosing “Add”, “Existing Project”, and then choosing the right csproj file for the Models project.

Resources