简体   繁体   English

在 Visual Studio 中包含自动生成的静态内容

[英]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.

相关问题 自动生成的代码在Visual Studio 2015中引发很多警告 - auto-generated code throw lots of warning in visual studio 2015 如何模拟Visual Studio自动生成的SOAP客户端? - How to mock SOAP client that was auto-generated by Visual Studio? Visual Studio自动生成文件开头的那些字符是什么? - What are those characters at the beginning of Visual Studio auto-generated files? 为什么 Visual-Studio 为一个应用程序自动生成 app.config 而不是另一个应用程序? - Why has Visual-Studio auto-generated app.config for one application but not for another? Visual Studio服务参考和自动生成的代理类-为什么不应该在您的类/项目中传递它们? - Visual Studio Service Reference, and Auto-Generated Proxy Classes - Why should they not be passed around your classes/projects? WPF中自动生成的代码显示错误。 (C#,WPF,Visual Studio社区2013) - Auto-generated code in WPF shows error. (C#, WPF, Visual Studio Community 2013) 自动生成的代码需要制作静态类 - Auto-generated code needs to make static class 自动生成的代码 - auto-generated Code 自动生成类的反序列化 - Deserialization of Auto-Generated Classes 自动生成的备用密钥 - Auto-generated Alternate Key
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM