Command BuildOnlyProject disabled - c#

I have added the command BuildOnlyProject to the Menu. But it is always disabled. It is also disabled, when I select a Project-Node in the Solutionexplorer.
Does someone know why?
Thanks and best regards, Thomas

Visual Studio does not support project only builds for C# or Visual Basic projects, only for C++ projects. If you have a mixed solution with both C# and C++ projects in it you can select a C++ project in the Solution Explorer and you will see:
Build -> Project Only -> Build Only CPlusPlusProjectName
in the menu. Using this menu option will literally cause just a single project to be built as demonstrated by the output window. On the other hand, if you select a C# project, the "Project Only" sub-menu will be gone and the only way to build the project will be with:
Build -> Build CSharpProjectName
When you use this menu option the selected project and any other projects that the project depends on will also be built, often several projects in all.
This is why if you select a project that is not a C++ project the "Build Only Project" command will be disabled.

Do you want anything to happen that would be different from the command Build.BuildSelection? It seems that Build.BuildProjectOnly does not work, and MS seems to imply that what people want is Build.BuildSelection.

If you want to get dirty why not add a special build configuration to your project which only includes the one project you want to build
only the selected projects will be build.

MSBuild checks for a property called BuildProjectReferences. So if you're running MSBuild manually, you can issue:
MSBuild.exe My.Project.csproj /p:BuildProjectReferences=false

Related

Auto refresh/reload dlls between two solutions

I have 2 visual studio solutions. So I am working with 2 visual studio instances.
One project in the first solution is referencing to another project in the second solution.
When the dll is changed on the disc is not refreshed in my solution. I dont get all the metadata.
Is there anyway to auto load changed dlls?
Thanks
As Commented by #mcNets,
You can add two projects in a single solution & then assign
dependencies in the projects.
To assign dependencies to projects
In Solution Explorer, select a project.
On the Project menu, choose Project Dependencies.The Project Dependencies dialog box opens.
On the Dependencies tab, select a project from the Project drop-down menu.
In the Depends on field, select the check box of any other project that must build before this project does.
Your solution must consist of more than one project before you can create project dependencies.
Right click on your solution Choose Batch Build.
It will open the dialog where you can see all the projects in the solution.
Now check all the checkboxes in the build column for your project and also for the referenced project. both release and debug config.
Now click on build.
Once build is complete run your project.
Your problem will be resolved.

Cannot build C# project in Visual Studio

I am an experienced developer who is completely new to C# and windows development.
I would like to contribute to Rocksmith custom song creator with a simple feature, but I don't even know how to build and run the project in Visual Studio 2012. I cloned the git repository, double clicked on devtools/devtools.csproj then Debug -> Start Debugging but I get an error about not being able to start a class directly.
You can browse the source code of the project at: https://code.google.com/p/rocksmith-custom-song-creator/source/browse/
From what I can tell, you have selected a sub-project in your solution to be the starting-project.
See, if there is project that defines a Window (WinForms or WPF), right-click this project and select it as starting project.
From MSDN
You can specify which project or projects within a multi-project solution Visual Studio will build and debug first.
To set a single startup project
In Solution Explorer, select the desired startup project within your solution.
On the Project menu, choose Set as StartUp Project.
The .csproj is just a project, you need to put that into a Solution (or open the solution included, if any)
Do you have a .sln file? Probably that's the one you must open.

Unload .vdproj (visual studio deployment project) from visual studio 2010 solution

I have a solution under source control, one of the projects in it is vdproj (Visual Studio Deployment Project) or setup project, this project gives me very annoying tens of messages every time i try to build the solution
---------------------------
Microsoft Visual Studio
---------------------------
The command you are attempting cannot be completed because the file 'XXXXInstaller.vdproj' is under source code control and is not checked out.
---------------------------
OK Help
---------------------------
The question is: How to unload this project from the solution, when i try to unload it, there are no such option in the right-click context menu!
I've found the issue raised on Microsoft Connect. It seems that "unload" is supported, but just not shown on the context menu. In other words, selecting the project and using the normal "Project" menu (next to "View") still shows the option "Unload project".
Another idea: If you keep your the deployment projects in a solution folder, you can use "Unload all projects in solution folder" from the context menu provided by the Microsoft Productivity Power Tools.
#MSS, as a work around you can edit the solution file by commenting the corresponding .vdproj project.
You can also select multiple projects in Solution Explorer (you will be able to unload at least one of them) and unload them. Then reload required projects.

Visual Studio Build Avoidance when building many C# projects

I have a solution with a lot of C# projects. The dependencies are not cyclic and when I build a high level DLL it appears to be rebuilding all the project referenced DLLs that it is linked to before running the program.
This seems to be unneccessary because I did not change the code in those DLLs and they are at a lower level so the changes I made in the top level DLL should in no way effect the low level DLLs.
How can I tell visual studio to only build DLLs that depend up the hierarchy chain not both ways.
Go to Tools->Customize
A dialog will open. Go to Commands tab. In menu barradio select Build | Project only. Assign a shortcut to it and use it.
When visual studio checks dependencies, it runs the build process. This is not necessarily building your project. In Visual Studio, if you navigate to Tools->Options...->Projects and Solutions->Build and Run you will see a drop downs labeled MSBuild project build output verbosity. If you change this to Detailed. When you build, you will see, in the output window, that it is verifying whether or not files have changed in order to determine if it should rebuild the project. This is why it appears to be building every time.
You should use the following setting:
"Only build startup projects and dependencies on Run" under Tools / Options / Projects and Solutions / Build and Run.

Visual Studio 2010: How to enforce build order of projects in a solution?

I had no problem with this in Visual Studio 2008 but it seems that VS 2010 is having an issue, and I'm betting it's probably me.
I have a solution with an ASP.NET Web Site Project and a few C# projects (BLL, DAL, Tests in NUnit). I have configured the build process for the test project to automatically run NUnit to run the tests. I would like to ensure that the BLL and DAL projects build before the test project so that the tests will run against the latest compiled version (yes, I know I could do this all in one project, but I'm choosing not to -- please bear with me :) )
So, I set the dependencies of the Test project to include the BLL, DAL, and Web Application projects, and the build order shows BLL, DAL, Web Application, and then Tests. However, I noticed that the BLL doesn't actually build when I build the Test project.
Any idea what this could be or any option I might be missing to force the other projects to build when I build the Test project?
Nick Craver mentioned checking the Configuration Manager to ensure you have the project selected to build for a given configuration.
However, to set the build order for multiple projects in a solution right click the solution and choose "Project Build Order..." from the context menu.
I'll expound upon my comment a bit here, for those having a similar issue.
Open up the configuration manager by right clicking on the solution and choosing Configuration Manager, then make sure build is checked for the appropriate project (for your current configuration) in the right-hand column here:
Maybe instead of setting order manually you could use Project Dependencies which allows you to specify build order indirectly.
In Solution Explorer, select a project.
On the Project menu, choose Project Dependencies. The Project Dependencies dialog box opens.
The Project Dependencies option is only available in a solution with more than one project.
On the Dependencies tab, select a project from the Project drop-down menu.
In the Depends on field, select the check box of any other project that must build before this project does.
To correct the issue happening in my VS2012, I did the following:
Right click Project Properties --> Common Properties --> Framework and References
Now you will find some projects shown on the Dependence Tab are missing in the "References" list.
Click "Add New Reference" to add the missing the projects.

Categories

Resources