In a .csproj file, what is for?

后端 未结 8 628
北恋
北恋 2020-12-23 20:02

How is


different from


?<

相关标签:
8条回答
  • 2020-12-23 20:48

    I have a project that contains no compilable items (it stores html and javascript for jasmine unit tests).

    One day my solution (that contained said project) stopped compiling saying "The target "Build" does not exist in the project".

    I added an import to bring in the compiler, which worked fine on my machine but failed using msbuild on the build server.

    <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    

    I then changed a line from

    <None Include="SpecRunner.html" />
    

    to

    <Content Include="SpecRunner.html" />
    

    and it worked on the build server as well.

    0 讨论(0)
  • 2020-12-23 20:50

    The MSDN article on the build action property explains the differences.

    None - The file is not included in the project output group and is not compiled in the build process. An example is a text file that contains documentation, such as a Readme file.

    Content - The file is not compiled, but is included in the Content output group. For example, this setting is the default value for an .htm or other kind of Web file.

    0 讨论(0)
提交回复
热议问题