Azure的Web角色部署不会复制非项目文件 [英] Azure web role deploy does not copy non-project files
问题描述
我们正在尝试部署AngularJs网站,蔚蓝的是建立与一饮而尽。因此,我们开发了源应用和吞掉将文件复制到该项目DIST。该DIST项目是一个Azure云源Web角色。在编译文件是项目文件夹内,但出于某种原因,他们不会被复制。
We are trying to deploy an AngularJs website to azure that is build with gulp. So we develop in a source application and gulp copies the files to the dist project. The dist project is a Azure cloud source Web Role. The "compiled" files are inside of the project folder, though for some reason they are not copied.
我们开启该选项的属性的 - > 封装/ Publich网站的 - > 在这个项目文件夹中的所有文件的
We turned on the option Properties -> Package/Publich Web -> All files in this project folder
部署我只看到packes.config,web.config文件和bin文件夹后。有什么需要我们做的就是文件的部署休息?
After deploying I only see the packes.config, web.config and bin folder. Is there anything we need to do to get the rest of the files deployed?
推荐答案
没错,吞掉生成的文件实际上不是项目(包含在xx.csproj文件)的一部分,这就是为什么所有文件...不工作。我们通过添加一些自定义目标构建项目文件做到这一点 - 我们一饮而尽文件是一个名为DIST
Yep, gulp generated files are not actually part of the project (included in the xx.csproj file) which is why "All files..." does not work. We accomplish this by adding some custom targets for build to the project file - our gulp files are in a folder called "dist".
卸载项目>>编辑...然后包括像:
Unload Project >> Edit... then include something like:
<Target Name="CustomCollectFiles">
<ItemGroup>
<_DistFiles Include="dist\**\*" />
<FilesForPackagingFromProject Include="%(_DistFiles.Identity)">
<DestinationRelativePath>dist\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
<_SrcFiles Include="src\**\*" />
<FilesForPackagingFromProject Include="%(_SrcFiles.Identity)">
<DestinationRelativePath>src\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
<PropertyGroup>
<TypeScriptModuleKind>AMD</TypeScriptModuleKind>
<CopyAllFilesToSingleFolderForPackageDependsOn>
CustomCollectFiles;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
CustomCollectFiles;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
</PropertyGroup>
.
.
.
<Target Name="AfterBuild" DependsOnTargets="CustomCollectFiles">
<Copy SourceFiles="@(_DistFiles)" DestinationFolder="dist" />
</Target>
这篇关于Azure的Web角色部署不会复制非项目文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!