I have two native c++ projects in a VS 2010 solution, projects A and B. I would like B to reference all of the files in A. Is there an automated way for B to reference all of the files included in A? To make this clear, I don't want to reference project A, just the files in the project.
I know I can go through the "Add Existing Item" route and manually add all of the files from A into B, but A changes periodically and I'd like B to take that into account dynamically. Is there any settings I can use in VS 2010 to accomplish this, or do I have to set up some type of automated script outside of VS 2010 to add the files to B?
To add more complexity to this, project A has a set of filters. The optimal solution would allow me to reference the files under a specific set of filters in project A.
Related
Our company is planning to start a large new WinForm project, it will be written in c#-4.0 using Visual Studio 2010.
This project will have many modules (Production, Accounting, Service and etc...) and each module with have lots of possible forms. So we are testing the idea of create multiple projects inside a single solution and have each module be it's own project rather then having a single very large project.
I created a test solution with two projects A and B, next I added each project as a reference to the other project, when adding one project as a reference to the other, I right clicked on Reference>Add Reference>Browsed to the other projects bin/Debug folder and added the other project's .exe as the reference. Next, using the other project as a namespace I was able to do things like form inheritance and opening forms or calling methods between my two test projects.
But I accidently clicked Clean Solution which cleaned the bin/Debug folder for my two projects, and all of my references between the two projects were broken.
What is a proper and reliable way to add permanently references between projects inside a single solution? I was thinking I could physically copy each project's .exe into the other projects bin, then add it as a reference. But that means I'll have to manually re-copy it every time the other project get's updated.
In every tutorial and HowTo site (like here) about WiX I read I should add reference to my other project, but when I select Add Reference I have nothing on Project list in Project tab. I try this on Visual Studio 2012, earlier with WiX 3.7 and now on 3.8.
If there is solution simply not using "Add Reference" function how can I build this other way? I'm a beginner so I don't really know how to use WiX without this feature, if I published my C# application in Publish Wizard I should add all produced files to Component Group with every file in <Component> tag?
It could be this simple...
In Visual Studio, Add Reference's Project tab only lists projects in the same solution. You just need to Add Project to the solution and go back to the Add Reference's dialog.
A solution is just a set of zero or more projects that can be built together. You can have a project in more than one solution. The only limitation is that if project B references project A (B is downstream of A), A should be in every solution that contains B. If the universe of projects is small, it is typical to have only one solution for them all. On the other hand, if one developer works only on upstream projects, that developer might find it easier to work with a solution that doesn't have downstream projects.
Setup projects tend to be downstream but note that they probably don't depend on library test projects.
[Stream is not the best technical term. The universe of connected projects is a directed acyclic graph.]
My IDE is Visual Studio 2010. I have a solution (.sln) containing more than 100 Projects (.vcproj). The language is C++. The solution has two configurations: "Release" and "Debug". The solution has two Platforms "Win32" and "x64". I need to create a third configuration, let's call it "Release_and_PDB". "Release_and_PDB" should be equal to "Release" except in that it should generate the PDB files. In the future "Release_and_PDB" should be always equal to "Release" except in that it should generate the PDB files. I think I can do it in three steps:
Create a new Configuration.
Manually change every project property adding the path and name for the PDB (in Linker, Debugging, Generate Program Database file).
Ensure that a property change in the Release will also reflect the same change to the Release_and_PDB configuration
My questions:
a. Does Visual Studio have any facilities to get the step 2 done without the need of manually changing the properties of any (and every) project?
b. Does Visual Studio have any facilities for the inheritance of project properties to get step 3 done without the need to also manually change the property in Release_and_PDB?
You go to configurations manager in the toolbar -> new -> copy settings from.
I think that's what you're looking for.
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.
In Visual Studio there is a way to have a file in another project that is a shortcut to the first so that it builds in both. How do I do that?
Right-click the project, select Add > Existing Item, and in the dialog drop down the Add button and select Add As Link.
This is not a direct answer but an alternative that may be worth considering in some cases.
You can create a specific kind of project which can "include" a set of files in another project when it is added by reference. This is called a Shared Project which is one of the 'new project' options:
(Since at least Visual Studio 2015 - maybe earlier).
One advantage of this type of project over individual shortcuts is that it includes a set of things as a bundle. So if you have a large # of items, this may be easier and less error prone.
Also it uses the familiar "reference" metahphor in the context of the solution and in that way functions quite similarly to other project references; the difference is that in a shared project the items in the project are added into each referring project, but in a normal project the assemblies (DLLs) end up owning the reference at runtime. Shortcuts may be less familiar to other developers than the reference pattern.
More information: What is the difference between a Shared Project and a Class Library in Visual Studio 2015?
Are you talking about a solution with multiple projects? In that case answer would be using Project Dependencies (within Project menu).