【发布时间】:2013-06-27 23:17:14
【问题描述】:
我在发布到 Cloud Azure 时尝试将多个 html 文件合并为一个,我将以下内容添加到 .csproj 文件中
<Target Name="AfterBuild">
<CreateItem Include="$(ProjectDir)js\ordering-widget\tpl\*.html">
<Output TaskParameter="Include" ItemName="htmlFilesToCombine" />
</CreateItem>
<ReadLinesFromFile File="%(htmlFilesToCombine.FullPath)">
<Output TaskParameter="Lines" ItemName="htmlLines" />
</ReadLinesFromFile>
<WriteLinesToFile File="$(ProjectDir)js\ordering-widget\tpl\combined.html" Lines="@(htmlLines)" Overwrite="true" />
</Target>
但是,我收到拒绝访问错误
$/Allegro Web/Allegro Web/Allegro Web.sln ('Allegro Web:Publish' target(s)) - 1 error(s), 1 warning(s),View log file
C:\a\src\Allegro Web\MvcWebRoleCore\MvcWebRoleCore.csproj (983): Could not write lines to file "C:\a\src\Allegro Web\MvcWebRoleCore\js\ordering-widget\tpl\combined.html". Access to the path 'C:\a\src\Allegro Web\MvcWebRoleCore\js\ordering-widget\tpl\combined.html' is denied.
这显然是一个天蓝色的权限错误,如何解决这个问题。谢谢。
【问题讨论】:
-
您是发布到 Azure 网站还是 Azure Web 角色?
-
@IUnknown Azure 云服务,Azure Web 角色
-
我还没来得及查看 tfsbuild 的目录宏到底是什么,但我发现我可以写入 c:\a\bin 目录,但不能写入 c:\a \src 目录。尝试改用 $(TargetDir) 或从 $(OutDir) 派生的东西。