msbuild can't find project reference in same solution if it is not selected to build in configuration (ex. "error CS0246: The type or namespace name 'A' could not be found") - by RamiAbuGhazaleh

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


6
1
Sign in
to vote
ID 770426 Comments
Status Closed Workarounds
Type Bug Repros 5
Opened 11/7/2012 6:29:00 PM
Access Restriction Public

Description

If a solution contains projects A and B, project B references project A, trying to build the solution with a configuration where only B is selected to build fails to "find" project reference A.

It works without issues in the Visual Studio 2010 IDE.
Sign in to post a comment.
Posted by Hugues DESCHAMPS on 8/21/2013 at 3:37 PM
I had the same issue, the difference between my code and a formal .csproj file is this line below :
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

I had this line on my code and now its working but I got an unexpected file .pdb

Regards
Posted by Microsoft on 11/15/2012 at 5:46 PM
Thank you for your feedback. This is an intentional change made in VS 2012. Projects excluded from a build configuration do not get built when you are building that configuration.
Posted by Microsoft on 11/15/2012 at 5:46 PM
Thank you for your feedback. This is an intentional change made in VS 2012. Projects excluded from a build configuration do not get built when you are building that configuration.
Posted by SnaggenLLC on 11/15/2012 at 10:22 AM
I also would like to confirm this issue. I have a web project which references another project for DataAccess. Both projects are in the same solution.

Everything builds correctly in Visual Studio. When I try to use MSBUILD it fails to build the DataAccess and copy the DataAccess dll up to the WebProject before building the WebProject.

Since the web projects has a reference to the DataAccess project this causes the built of the entire solution using MSBuild to fail.

Please advise on workaround.
Posted by Microsoft on 11/12/2012 at 2:58 AM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been reproduced and has been routed to the appropriate VS development team for review. We will contact you if we require any additional information.
Posted by RamiAbuGhazaleh on 11/8/2012 at 12:48 PM
It also happens when using Visual Studio 2012 to create the solution and projects which target .net 4.5. See newly attached zip.
Posted by RamiAbuGhazaleh on 11/8/2012 at 1:49 AM
This issue is not related to Visual Studio 2010.
It is related to .net framework v4.0, specifically c:\windows\framework\v4.0:30319\msbuild.exe
Posted by Microsoft on 11/8/2012 at 12:30 AM
Thanks for your feedback . The product team itself no longer directly accepting feedback for Microsoft Visual Studio 2010 and earlier products. You can get support for issues with Visual Studio 2010 and earlier by visiting one of the resources in the link below:
<http://msdn.microsoft.com/en-us/vstudio/cc136615.aspx>
Posted by Microsoft on 11/8/2012 at 12:29 AM
Thanks for your feedback . The product team itself no longer directly accepting feedback for Microsoft Visual Studio 2010 and earlier products. You can get support for issues with Visual Studio 2010 and earlier by visiting one of the resources in the link below:
<http://msdn.microsoft.com/en-us/vstudio/cc136615.aspx>
Posted by Microsoft on 11/8/2012 at 12:29 AM
Thanks for your feedback . The product team itself no longer directly accepting feedback for Microsoft Visual Studio 2010 and earlier products. You can get support for issues with Visual Studio 2010 and earlier by visiting one of the resources in the link below:
<http://msdn.microsoft.com/en-us/vstudio/cc136615.aspx>
Posted by Microsoft on 11/8/2012 at 12:28 AM
Thanks for your feedback . The product team itself no longer directly accepting feedback for Microsoft Visual Studio 2010 and earlier products. You can get support for issues with Visual Studio 2010 and earlier by visiting one of the resources in the link below:
<http://msdn.microsoft.com/en-us/vstudio/cc136615.aspx>
Posted by RamiAbuGhazaleh on 11/7/2012 at 7:03 PM
Also see this discussion:
http://social.msdn.microsoft.com/Forums/en-CA/msbuild/thread/434abf1a-30db-4b13-8062-13755898dd71
Posted by Microsoft on 11/7/2012 at 6:51 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)