一千萬個為什麽

搜索

Visual Studio 2013解決方案構建不在構建順序中

我有問題讓我的C#解決方案構建“新鮮”。如果我清理解決方案並重新構建它,它將不會構建(我可以做幾次,然後構建它)。它有一個關於azure項目在它所依賴的worker和web項目之前獲得構建的錯誤。關於解決方案中大多數項目是如何尋找的

WAT070 : The referenced assembly {...}/Worker.dll was not found. 
Please make sure to build the role project that produces this assembly before building this Windows Azure Cloud Service Project.
{...}\VisualStudio\v12.0\Windows Azure Tools\2.2\Microsoft.WindowsAzure.targets 1252    5   AzureProjectName

Now if I build the projects in the order listed in the Project Dependencies -> Build Order everything works. Also, the web and work role are listed before Azure Project.

最佳答案

您的問題可能是依賴性未定義。即使Build Order顯示了構建項目的順序,但如果您沒有為Project Dependencies下的每個項目依賴性定義依賴關系,則msbuild在繼續之前不會知道 wait 的依賴關系構建完成。

To clarify: Unless you actually check the box that an item is a dependency, the projects in the build order list may build in parallel and not sequentially.

You can see under Tools->Options->Project and Solutions->Build and Runthat there is a default value for the number of parallel projects to build. enter image description here

So to make the build process wait for dependencies to build make sure that all of the "Depends on" fields are checked for the projects needed under Project Dependencies -> Dependencies.

轉載註明原文: Visual Studio 2013解決方案構建不在構建順序中