I have a solution in Visual Studio 2010 which contains multiple projects. All of those projects share a common directory for header files and library files. When I go to Tools->Directories it tells me this approach is deprecated and that there is a separate Directory properties for each project. Surely Microsoft don't expect me to now add these settings to each project individually. Is there not a top level property which all projects inherit and then this project specific property? Am I missing something or do I really need to do this per project now?
What you want to use are called PropertySheets.
When used right they are very powerful, especially for large projects.
With these you can specify much more common things, than just only different directories.
Related
I have a ASP.NET project that consists of many C# libraries in addition to the web project. The problem (for some reason) is that all projects that make up the web application are NOT added into one solution within a same visual studio. Instead, most projects are separated within individual visual studio. All projects are stored in source control, and shared by other developers.
Thus, the question is that how to find usage of any code, like "Find Usage" via Resharper. Is there any tools or tricks that allows me to do that like Resharper's Find Usage.
Any advice?
It looks like you're in something of a bind. My suggestion would be to simply make your own source control branch, and in that branch, you can create a new SLN file, add all of the projects, replace their binary project references by project references and then call Find Usages. Then, if you need to do any changes on the basis of Find Usage info, simply merge those in without merging PROJ or SLN files.
If these library projects are referenced as DLL files rather than the project references the only way is to open all the one-project solutions and search there by 'text'. There are some tips/tricks, which could simplify navigation a bit.
P.S. The situation you described looks far from convenient. I agree with Dmitri - you might consider to discuss with your team to switch onto referencing projects rather than using binaries. Once you switch each developer will be able to create local either solutions with the projects involved, or maybe you will agree on new common source controlled solutions.
Can I have a freehand in using any arbitrary folder hierarchy within a Visual Studio project? Does the runtime/VS actually care about how I create the folders?
Visual Studio doesn't care about the folder structure you use. Everything is typically tied together based on file types and the references in your project (csproj, vbproj, etc) file.
That said: in general it is best to stick to the conventions laid out by Microsoft for common files, since people are used to look for them in the places.
If I have a project called 'testing' in project A.
How can I share that folder 'testing' for project B in visual studio 2010?
The reason I would like to achieve about this is because when I change something in the folder testing of project A, I dont want to change the same things in project B.
Thanks in advance.
Maybe too late for the person who asked the question, but this is for people with similar problems. You can share folder contents with an extention 'Project Linker':
This builds upon the concept of linked files where you refer to the same file from two projects. This extention handles the management of that for an entire project. If you add a file to the project, it will be added too to the other project as a linked file. Same for deletes...
Attention: you need to have both projects in the same solution for this to work of coarse...
Extention VS2015
I used it in VS2010 and it's also availible for later versions.
You can't share folders in Visual Studio - they are logical constructs that are part of a solution or project.
The closest you can get is to add folders to the projects you need to share on and add all the files that you want to share as links. You will still need to manually synchronize all adds/deletes of files, but updates will come across all projects.
To make things easier, you may want to write a Visual Studio macro that synchronizes these folders for you (you can bind these to keyboard shortcuts and/or menu items).
If you put your solution (*.sln) files in the same directory they can share files in sub directories.
I am comming from the Java world where I usually worked with Eclipse and IntelliJ. Both IDE's allowed one to specify a folder in the project directory to be the root folder for my sources. Typically this was a folder named "src" or "source". In Visual Studio 2010 I found an option on the 'Build' tab of the project properties screen that allows me to change the output directory but I was not able to find something for the 'input' directory. Is it possible to define such an 'input' directory?
You can simply add directories into your project. Open up the project in Visual Studio -> Right click on the project -> Add -> New Folder.
You can also link files into the project while they reside elsewhere.
Besides that, using those directories is quite uncommon in .NET so you should think about adapting the common habbits of the new platform to successfully develop for the new platform. Special-purpose solutions tend to do more harm.
In visual studio you can define a "default" root for all your projects. You do so by going to Tools -> Options -> Projects and Solutions and setting the first textbox "Projects location".
After that, you should know and follow how .Net projects are arranged.
Let's say you are creating a website called "TestSite". You will have a root folder with that name, and in that folder you will have a solution file "TestSite.sln" and as many subfolders as the number of projects your solution will be made of. A common scenario could be the following:
TestSite.sln
TestSite.Bll
TestSite.Dal
TestSite.Web
That would be three projects, the first two of type "Class library" as they are your business layer and data layer, and the third of type "Web application" or "Mvc application" (which is much better).
You can reference the projects between them, and when you compile you get everything tied together.
Generally project sources is placed where the project file is.
In C++ projects you can specify include folders. In C#/VB you may edit .csproj/.vbproj file as text file and change what you want.
Also you can add existing items into project.
And read this article
Can someone briefly explain to me the difference between Visual Studio's solution file (.sln) and project file (.vcproj).
It seems to me opening either one open the correct solution/project in Visual Studio. Is one the super-set of the other?
Note: I am currently using Visual Studio 2008 working on a project that was brought forward from Visual Studio 2005 (I believe).
A solution is a set of projects. If you need more than one project in your software, then go with solutions. I.E.: A Class Library Project + A Web Application Project.
A project file typically corresponds to a single module: EXE or DLL or LIB. A solution manages a collection of project files.
A solution is a collection of projects. Visual Studio is made so that it cannot function without a solution, so if you open a bare project, it will generate the solution automatically (or try to find one).
One solution can contain zero or more projects. Everything is in projects, so a solution with zero projects doesn't contain anything at all besides the solution properties.
Visual studio keeps track of where the projects are used, so if you open a project file, it will open (IIRC) the last solution where it was used.
When you create a project from scratch, a solution is also created, but it's not shown until you add another project to it. It looks like you have only the project open, but it's actually a solution containing the project that is open.
Specifically project files are intended to contain the data required to build the files in the project into an exe or dll. This file is utilized by the local compilers or with systems such as Team Foundation system and server side build agents.
Solutions are a client (IDE) construct designed to manage collections of projects, which in effect is a collection of different build definitions and associated files.
Solution files are typically made up of multiple project files.