[英]Including auto-generated static content in Visual Studio
My web application has a node process that runs things like transpilation and minification, and produces a bunch of output files.我的 Web 应用程序有一个节点进程,它运行诸如转译和缩小之类的事情,并生成一堆输出文件。 We've had problems with our CI server not sending these auto-generated files out unless they were manually included in the project.我们的 CI 服务器遇到了问题,除非将它们手动包含在项目中,否则无法将这些自动生成的文件发送出去。
Manually including auto-generated files is a pain, is easy to forget, and just an all-around bad idea.手动包含自动生成的文件很痛苦,很容易忘记,而且只是一个全面的坏主意。
How can I get visual studio to just include everything under a specific folder, no matter what.无论如何,我怎样才能让 Visual Studio 只包含特定文件夹下的所有内容。 I just need these files to exist to my script loader can load them when needed.我只需要这些文件存在于我的脚本加载器中即可在需要时加载它们。
Per this answer I tried根据这个答案我试过了
<Target Name="BeforeBuild">
<ItemGroup>
<Content Include="2\application-base\**\*.js" />
</ItemGroup>
</Target>
to no avail.无济于事。 After adding that I've tried building the solution, the project, re-building the project, none of which cause anything in that folder to show up in the solution explorer as included.添加后,我尝试构建解决方案、项目、重新构建项目,这些都不会导致该文件夹中的任何内容显示在解决方案资源管理器中。
Just put Content
in the main ItemGroup
of the project.只需将Content
放在项目的主ItemGroup
中。
Ie IE
<ItemGroup>
<Content Include="2\application-base\**\*" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.