csproj 中的显式文件列表

问题描述 投票:0回答:2
c# .net msbuild
2个回答
0
投票

您可以通过首先排除所有 .cs 文件,然后包含您需要的文件来完成此操作。例如:

<ItemGroup>
  <Compile Remove="**/*.cs" />
  <Compile Include="./Program.cs" />
</ItemGroup>

请注意,

**
是一个通配符,允许搜索所有目录。请参阅此处了解更多信息。


0
投票

您可以将 通配符 用作

Remove
属性。类似于以下内容:
Compile

© www.soinside.com 2019 - 2024. All rights reserved.