Reputation: 1905
Firstly I apologise if I'm missing something obvious but I cant seem to find the answer anywhere!
What I have is a solution with a number of class library projects containing supporting classes and controllers etc and an MVC project containing the views.
What I want is to be able to build this set of projects to another location (ie c:\build) and to be able to run VS debug from this build location. This is so that the dll and pdb files are not constantly updated and checked into the source control and are simply built to another location on the users PC by default.
What i have done is changed the csproj xml file to have the following entries in it.
<BaseOutputPath>c:\build\$(AssemblyName)\$(Configuration)\</BaseOutputPath>
<OutputPath>$(BaseOutputPath)\bin\</OutputPath>
<BaseIntermediateOutputPath>$(BaseOutputPath)\obj\</BaseIntermediateOutputPath>
Now this works perfectly for the class library projects and for the dll created by for MVC project itself. VS creates the relevant folders and builds the correct dll files into them including building any dependant project dll into this folder structure.
However what also seems to happen in the MVC project is it still seems to build the dependant dlls into the \bin folder of the project (but does not build itself there). It also seems that when you run the project it tries to run from the code in this \bin folder of the project and as it cant find the dll for the MVC project it falls over.
Is there anyway to stop VS from building the dependant DLL files into the \bin folder and to tell it to look at the build location for the built DLLs?
I have looked on the MSDN website regarding proj files and come up with a number of different solutions but none of them work.
Any help would be much appreciated.
Upvotes: 3
Views: 660
Reputation: 18746
Hopefully this behavior IS MSBuild dependent instead of VSBuild, since the two build processes differ. If you are in luck, and this is following the same behavior as MSBuild, I would follow the MSBuild debugging process:
As with any magical behavior in MSBuild, in your .CSProj
file look for any import target=
code and go find those files. Following these through will lead you to the part that is making the decision about any of this.
You can attach VS's debugger to your build process - http://blogs.msdn.com/b/visualstudio/archive/2010/07/06/debugging-msbuild-script-with-visual-studio.aspx + http://blogs.msdn.com/b/visualstudio/archive/2010/07/09/debugging-msbuild-script-with-visual-studio-2.aspx
Also, you can crank up the build verbosity, temporarily http://blogs.msdn.com/b/msbuild/archive/2005/09/29/475157.aspx
Upvotes: 2