我在Visual Studio 2015中有一個.NET Azure解決方案。該應用程序使用2個輔助角色。構建團隊服務失敗
作爲其功能的一部分,在構建過程中的某個時刻,將一些dll複製到雲項目中,以便最終得到最終結果。
爲了使工作我已在「ServiceDefinition.csdef中」以下內容:
<WorkerRole name="SomeProject.Foreman" vmsize="Small">
<Contents>
<Content destination="ClientCustomCode">
<SourceDirectory path="ClientCustomCode" />
</Content>
</Contents>
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" />
<Setting name="SomeProjectDocumentDBURI" />
<Setting name="SomeProjectAuthorizationKey" />
<Setting name="LogLevel" />
<Setting name="RequestQueue" />
<Setting name="RequestErrorQueue" />
<Setting name="NumberOfConcurrentRequests" />
<Setting name="NumberOfRequestsToReadFromAzureQueue" />
<Setting name="StorageConnectionString" />
<Setting name="SomeProjectPnrHistory" />
<Setting name="SomeProjectClientRepository" />
<Setting name="SomeProjectMessagesInProcess" />
</ConfigurationSettings>
<LocalResources>
<LocalStorage name="InstallLogs" sizeInMB="5" cleanOnRoleRecycle="false" />
</LocalResources>
<Startup>
<Task commandLine="install.cmd" executionContext="elevated" taskType="simple">
<Environment>
<Variable name="PathToInstallLogs">
<RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/LocalResources/LocalResource[@name='InstallLogs']/@path" />
</Variable>
</Environment>
</Task>
</Startup>
</WorkerRole>
<WorkerRole name="SomeProject.Engine" vmsize="Small">
<Contents>
<Content destination="ClientCustomCode">
<SourceDirectory path="ClientCustomCode" />
</Content>
</Contents>
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" />
<Setting name="RequestQueue" />
<Setting name="RequestErrorQueue" />
<Setting name="SomeProjectDocumentDBURI" />
<Setting name="SomeProjectAuthorizationKey" />
<Setting name="LogLevel" />
<Setting name="NumberOfConcurrentRequests" />
<Setting name="NumberOfRequestsToReadFromAzureQueue" />
<Setting name="StorageConnectionString" />
<Setting name="SomeProjectPnrHistory" />
<Setting name="SomeProjectClientRepository" />
<Setting name="SomeProjectMessagesInProcess" />
</ConfigurationSettings>
<LocalResources>
<LocalStorage name="InstallLogs" sizeInMB="5" cleanOnRoleRecycle="false" />
</LocalResources>
<Startup>
<Task commandLine="install.cmd" executionContext="elevated" taskType="simple">
<Environment>
<Variable name="PathToInstallLogs">
<RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/LocalResources/LocalResource[@name='InstallLogs']/@path" />
</Variable>
</Environment>
</Task>
</Startup>
</WorkerRole>
在雲項目中,我添加在構建事件如下:
-- Pre-build
IF NOT EXIST $(TargetDir)ClientCustSomCode mkdir $(TargetDir)ClientCustomCode
-- Post-build
IF NOT EXIST $(TargetDir)ClientCustomCode mkdir $(TargetDir)ClientCustomCode
copy $(ProjectDir)ClientCustomCode\*.dll $(TargetDir)ClientCustomCode
copy $(ProjectDir)ClientCustomCode\*.pdb $(TargetDir)ClientCustomCode
在項目文件複製的dll實際構建的位置:
copy $(TargetName).dll $(SolutionDir)SomeProject\SomeProject.Cloud\ClientCustomCode
copy $(TargetName).pdb $(SolutionDir)SomeProject\SomeProject.Cloud\ClientCustomCode
現在,在本地構建時沒有問題。直到最近,它也建立在團隊服務,但出了藍色,沒有任何真正的原因(沒有改變)構建突然開始失敗,出現以下錯誤:
2016-08-23T08:37:40.3013767Z C:\a\1\s\SomeStuff\SomeProject\SomeProject.Cloud\ServiceDefinition.csdef : error CloudServices089: Cannot find the source directory 'C:\a\1\s\SomeStuff\SomeProject\SomeProject.Cloud\ClientCustomCode' in role SomeProject.Foreman. [C:\a\1\s\SomeStuff\SomeProject\SomeProject.Cloud\SomeProject.Cloud.ccproj]
2016-08-23T08:37:40.3013767Z C:\a\1\s\SomeStuff\SomeProject\SomeProject.Cloud\ServiceDefinition.csdef : error CloudServices089: Cannot find the source directory 'C:\a\1\s\SomeStuff\SomeProject\SomeProject.Cloud\ClientCustomCode' in role SomeProject.Engine. [C:\a\1\s\SomeStuff\SomeProject\SomeProject.Cloud\SomeProject.Cloud.ccproj]
生成日誌文件:Download 這裏有人可能有想法嗎?
可以共享整個構建日誌? –
我會將其添加到我的問題。 :-) – Fysicus
我已經包含構建日誌 – Fysicus