Question

I'm on VS2012 Update 3 using TFS2012.

I build the same solution using devenv and msbuild. When I get to the Web Site projects, devenv doesn't report any errors, but msbuild does repeatedly. Sample of the logs for both:

Devenv:

114>------ Build started: Project: C:\...\API\, Configuration: Debug Any CPU ------  
114>Could not get dependencies for project reference 'A'Could not get dependencies for     project reference 'BusinessLogic' Could not get dependencies for project reference 'BusinessLogic.ASPAgents' Could not get dependencies for project reference 'DataAccessLogicComponents' Could not get dependencies for project reference 'UI'Validating Web Site
114>Building directory '/API/'.  
114>  
114>Validation Complete

MSBuild:

121>C:\Scrubbed\API.metaproj : warning MSB3274: The primary reference "C:\Scrubbed\PreMVC\A\bin\Release\A.dll" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".  
121>C:\Scrubbed\API.metaproj : warning MSB3274: The primary reference "C:\Scrubbed\PreMVC\BusinessLogic\bin\Release\A.Web.BusinessLogic.dll" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".  
121>C:\Scrubbed\API.metaproj : warning MSB3275: The primary reference "C:\Scrubbed\PreMVC\BusinessLogic\bin\Release\A.Web.BusinessLogic.dll" could not be resolved because it has an indirect dependency on the assembly "A, Version=0.0.0.15, Culture=neutral, PublicKeyToken=060d385c0c45e767" which was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0".  

     C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v /API -p PreMVC\API\ -u -f PrecompiledWeb\API\ 

121>C:\Scrubbed\PreMVC\API\App_Code\File1.cs(7): error CS0234: The type or namespace name 'BusinessLogic' does not exist in the namespace 'A.Web' (are you missing an assembly reference?) [C:\Scrubbed\API.metaproj]  
121>C:\Scrubbed\PreMVC\API\App_Code\File1.cs(8): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'A.Web' (are you missing an assembly reference?) [C:\Scrubbed\API.metaproj]  
121>C:\Scrubbed\PreMVC\API\App_Code\File1.cs(12): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'A.Web' (are you missing an assembly reference?) [C:\Scrubbed\API.metaproj]  
121>C:\Scrubbed\PreMVC\API\App_Code\File2.cs(7): error CS0234: The type or namespace name 'BusinessLogic' does not exist in the namespace 'A.Web' (are you missing an assembly reference?) [C:\Scrubbed\API.metaproj]
121>C:\Scrubbed\PreMVC\API\App_Code\File2.cs(8): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'A.Web' (are you missing an assembly reference?) [C:\Scrubbed\API.metaproj]  
121>C:\Scrubbed\PreMVC\API\App_Code\File2.cs(12): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'A.Web' (are you missing an assembly reference?) [C:\Scrubbed\API.metaproj]
121>C:\Scrubbed\PreMVC\API\App_Code\File3.cs(7): error CS0234: The type or namespace name 'BusinessLogic' does not exist in the namespace 'A.Web' (are you missing an assembly reference?) [C:\Scrubbed\API.metaproj]
121>C:\Scrubbed\PreMVC\API\App_Code\File3.cs(8): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'A.Web' (are you missing an assembly reference?) [C:\Scrubbed\API.metaproj]  
121>Done Building Project "C:\Scrubbed\API.metaproj" (Rebuild target(s)) -- FAILED.

Any idea as to why Devenv carries on but MSBuild fails immediately?

Was it helpful?

Solution

I got an answer from a mod on MSDN forums. Basically MSBuild is extremely strict about dependencies where devenv just puts up warnings but carries on.

We ended up getting the go-ahead to move to .NET 4.5 entirely so we fixed the mismatch and ended up moving our build to MSBuild.

OTHER TIPS

Make sure you add project references to the other projects and that they are all using the same version of .NET framework.

Doesn't the warning in your logs tell the story?

"121>C:\Scrubbed\API.metaproj : warning MSB3274: The primary reference "C:\Scrubbed\PreMVC\A\bin\Release\A.dll" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0". "

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top