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.
Related
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.
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
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).
I'm using Visual Studio 2008 and would like to create a sort of container project that holds a number of DLL's that must be installed with a solution. I want them to be in a separate project so that they can be easily attached to a solution as a group.
I created an empty project call TEST, added my DLL's to it with a Build Action of "Content", and set them to "Copy Always". That all works exactly as I want. The problem is that if I set the TEST project Output Type to "Console Application" or "Windows Application" that it won't build because there's no entry point. If I set the Output Type to "Class Library", it builds but I end up with an extra TEST.DLL file that I don't really want.
Is there anyway to sort of set the Output Type to "none"? I want the build actions to take place (so my DLL's get copied) but I don't want the dummy class assembly created. Any ideas?
Thanks!
Assumptions for the following step-by-step guide:
Let's assume that you have a solution with two projects:
Main: your main (start-up) project.
BundledDLLs: a library project which contains the .dlls that should end up in the main project's output directory.
Step-by-step guide:
The easiest way to achieve your goal inside Visual Studio is probably the following:
Add all .dlls to BundledDLLs and set their Copy to output directory to Copy if newer.
This is done in the Project Explorer and the Properties windows.
Configure BundledDLLs's output directory to be identical to Main's output directory.
This can be done in the Build tab of BundledDLL's Project Properties page. Enter something like the following in the Output Path textbox:
..\Main\bin\Debug
Set up BundledDLLs as a dependency of Main.
Do not add BundledDLLs as a project reference to Main, as you usually might; instead, use the Project Dependencies dialog to . This will tell the build tool that whenever Main is built, BundledDLLs needs to be built first.
Do this by right-clicking on the Main project node to open the context menu; select Project dependencies... from there. In the now opened dialog, first select Main from the drop-down list; then check BundledDLLs in the project list below. BundledDLLs is now registered as a dependency of Main.
P.S.: One disadvantage of not having an explicit assembly reference in Main is that some tooling might not recognise the dependency. For example, ClickOnce deployment might not work properly.
Add a post-build event to BundledDLLs that deletes the superfluous BundledDLLs.dll.
As you said, you don't want, and don't need, the dummy output generated when BundledDLLs is built. So add a post-build event that simply deletes this .dll once it's been created.
Open the Build events tab in BundledDLLs's Project Properties page, and enter something like the following in the post-build textbox:
DEL "$(TargetDir)\$(TargetName).*"
(In case you wondered: The reason why you didn't add this project as a project reference to Main earlier is because if you had done so, Main would be looking for BundledDLLs.dll, which it wouldn't be able to find since you don't actually want such a file to be generated.)
P.S.: One disadvantage of adding such a post-build step is that it might interfere with incremental builds. If your project keeps getting recompiled from scratch after this, you might be better off removing the post-build step and living with the extra BundledDLLs.dll in your solution's output directory.
Another option is to use a makefile project, which doesn't require you to build/link anything.
In your project properties (right click property in solution explorer and click "Properties"), under "Configuration Properties" and then under "General", choose "Makefile" from the "Configuration Type" drop-down menu. The build output will include the warning "The property 'NMakeBuildCommandLine' doesn't exist...Skipping" but the build will succeed without building any dll/exe/etc.
While other answers here may better address your specific need, specifying a makefile more directly answers the question title "Possible to create Visual Studio project with Output Type of none?" I hope this is useful for people who google something to that effect and land here.
Credit goes to Xeek in the #winapi freenode irc channel for sharing this tip.
Instead of putting them in a project, you can put the files in a Solution Folder. One of your projects can have a build action that does the copying, but since they won't be in a project, they won't try to "build".
How do you remove the bindings from a VS Team project, is it just a matter of deleting ".vspscc" files?
What is the best way to do this, say I have a project on CodePlex and it is time to package it up for release, but by default the bindings come with the source so when others open the solution it interferes with it.
The simple way to unbind from source control:
Open your project
File -> Source Control -> Change Source Control
Select your project(s)
Click "Unbind"
What worked for me (under TFS, not codeplex)
Copy or move the project folder out of your workspace (I put it in c:\temp), and then open it in VS2008.
Visual studio then shows the following prompt:
The solution appears to be under source control, but its binding information cannot be found. Because it is not possible to recover this missing information automatically, the projects whose bindings are missing will be treated as not under source control.
After this, another dialog appears, as follows:
The solution appears to be under source control, but its binding information cannot be found. Because it is not possible to recover this missing information automatically, the projects whose bindings are missing will be treated as not under source control.
And you can chose Temporarily work uncontrolled, or Permanently remove source control association bindings.
Select the latter, do a Save All, and reload the solution. Profit!