Създаването на сайт чрез devenv.exe работи, msbuild е неуспешно

Аз съм на VS2012 Update 3, използвайки TFS2012.

Създавам същото решение с помощта на devenv и msbuild. Когато стигна до проектите на уеб сайта, devenv не отчита никакви грешки, но msbuild го прави многократно. Примерни дневници и за двете:

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.

Някаква идея защо Devenv продължава, но MSBuild се проваля веднага?


person jmcdade    schedule 23.01.2014    source източник
comment
Изпълнението на devenv от командния ред може да се различава от използването на msbuild по това, че може да изтегли някои потребителски/ui настройки, които не са в действие за msbuild. Просто случайна мисъл.   -  person Craig Celeste    schedule 24.01.2014


Отговори (3)


Получих отговор от мод във форумите на MSDN. По принцип MSBuild е изключително строг по отношение на зависимостите, където devenv просто поставя предупреждения, но продължава.

В крайна сметка получихме зелена светлина да преминем изцяло към .NET 4.5, така че поправихме несъответствието и в крайна сметка преместихме нашата компилация към MSBuild.

person jmcdade    schedule 24.01.2014

Уверете се, че добавяте препратки към проекти към другите проекти и че всички те използват една и съща версия на .NET framework.

person Nicodemeus    schedule 23.01.2014
comment
Питам защо едното изглежда работи, а другото се проваля. Така или иначе актуализирах проектите до .NET 4.5 и преминах към MSBuild, тъй като devenv произволно (от време на време - като 1 от 15 компилации) има проблеми с A task was cancelled. - person jmcdade; 24.01.2014

Предупреждението във вашите регистрационни файлове не разказва ли историята?

"121>C:\Scrubbed\API.metaproj: предупреждение MSB3274: Основната препратка "C:\Scrubbed\PreMVC\A\bin\Release\A.dll" не може да бъде разрешена, защото е изградена срещу ".NETFramework, Version=v4.5" framework. Това е по-висока версия от целевата рамка ".NETFramework,Version=v4.0". "

person Hamid Shahid    schedule 24.01.2014
comment
Въпросът (мисля) е защо работи за единия, но не и за другия. - person Craig Celeste; 24.01.2014