Azure发布云服务启动任务访问被拒绝错误

问题描述:

我写这篇文章是因为我们在尝试使用发布或打包云服务时遇到技术问题,因此在Windows 7上运行的Visual Studio 2013专业版的Azure SDK工具2.6Azure发布云服务启动任务访问被拒绝错误

我们能够建立整体解决方案,包括定期构建Ctrl + Shift + B云服务项目,但是当包装在构建过程中发布云服务失败。我们有我们的服务定义文件中的一些启动任务:

<Startup> 
<Task commandLine="Startup.cmd" executionContext="elevated" taskType="simple" /> 
<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> 

这是我们得到的错误: 访问路径 “C:\用户\欧文\应用程序数据\本地的\ Temp \ qzt5xaiq.133 \角色\ RoleName \ approot \ bin \ Startup.cmd'被拒绝。 C:\ Program Files文件(x86)的\的MSBuild \微软\ VisualStudio的\ V12.0 \的Windows Azure工具\ 2.6 \ Microsoft.WindowsAzure.targets 3003 5项目名

我们试过:

  • 运行VS管理员
  • 删除读文件夹上的限制,写
  • 清洁液
  • 做一个干净的检出
  • 重新启动Visual Studio中
  • 卸载Azure的SDK工具,并重新安装它们

东西,我们注意到的是,我们的高级和软件架构师有VS 2013终极版,无一不是能够没有问题发布或包,但团队的其他成员运行VS Professional会得到相同的错误。

如果我们从ServiceDefinition中删除启动任务,那么它就像一个魅力,但不知何故,当它们包含在运行专业版的计算机中时,它会失败。

在此先感谢,我们将非常感谢任何帮助。

最好的问候,

欧文卡米内罗

检查是否发布您的云服务应用程序。 您可能还有一个Startup.cmd文件。

这可能会导致问题。


解决方案:

在你的Azure项目,重命名文件CMD到别的像startup2.cmd

然后更新您的ServiceDefinition文件:

<Startup> 
<Task commandLine="Startup2.cmd" executionContext="elevated" taskType="simple" /> 
<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>