我在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