视觉工作室.projitems通配符
我修改了项目文件以包含带有通配符的目录中的所有 cs 文件。(见下文)。
不幸的是,每次我使用 Visual Studio 的解决方案资源管理器修改项目时,它都会删除这些通配符并添加到修改后的文件中。
我不想单独添加每个文件。 文档对此并不清楚。它指出应该支持。有人知道如何实现这一点吗?
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' < '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>f4ee43f1-9cbc-42af-85c0-69df3a128976</SharedGUID>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)**/*.cs" />
</ItemGroup>
</Project>
删除 1 个文件后(请注意,它现在隐藏了一大堆 .cs 文件):
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' < '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>f4ee43f1-9cbc-42af-85c0-69df3a128976</SharedGUID>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Test\Class1.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)Test\Models\" />
</ItemGroup>
</Project>
I modified the project file to include all cs files in the directory with a wild card.(see below).
Unfortunately every time I modify the project using visual studio's solution explorer it removes these wildcards and adds to modified files.
I would like to not have to add each file individually. The documentation isn't clear on this. It states that it should be supported. Anyone know how this can be achieved?
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' < '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>f4ee43f1-9cbc-42af-85c0-69df3a128976</SharedGUID>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)**/*.cs" />
</ItemGroup>
</Project>
After removing 1 file (Note that it now hides a whole bunch of .cs files):
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' < '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>f4ee43f1-9cbc-42af-85c0-69df3a128976</SharedGUID>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Test\Class1.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)Test\Models\" />
</ItemGroup>
</Project>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论