Including content files in .csproj that are outside the project cone

前端 未结 7 1702
忘掉有多难
忘掉有多难 2020-11-27 12:09

I have a C# project say MyProject.csproj located at \"C:\\Projects\\MyProject\\\". I also have files that I want copied into the output directory of this project. But, the f

相关标签:
7条回答
  • 2020-11-27 12:49

    To ignore a file in a .Net Core project:

    <ItemGroup>
     <Content Include="appsettings.local.json">
       <CopyToOutputDirectory Condition="Exists('appsettings.local.json')">PreserveNewest</CopyToOutputDirectory>
     </Content>
    </ItemGroup>
    
    0 讨论(0)
提交回复
热议问题