禁用vcproj中输出文件夹的配置名称
在 C# csproj 项目中,AppendTargetFrameworkToOutputPath 和 AppendRuntimeIdentifierToOutputPath 会阻止 msbuild 在生成输出目录中为目标框架和运行时创建子文件夹。但是,仍会附加配置名称。
是否有配置选项可以防止每个配置都有单独的子文件夹?
In a C# csproj project, AppendTargetFrameworkToOutputPath and AppendRuntimeIdentifierToOutputPath prevent msbuild from creating subfolders for target framework and runtime in the build output directory. However, the configuration name is still appended.
Is there a configuration option to prevent a separate subfolder for each configuration?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以我想出了一个解决方案。在 Visual Studio 中编辑项目设置时,它会修改 XML 项目文件中的
元素。只需将元素名称更改为
即可,它不会附加配置名称(正如您所说,添加false
和false
以禁用附加目标框架和运行时标识符)。例如,我在 C# 项目的
中有以下内容:对于调试构建,这会将构建文件输出到
\Build\Debug\插件
。So I figured out a solution to this. When editing the project settings in Visual Studio, it modifies the
<BaseOutputPath>
element in the XML project file. Simply change the element name to<OutputPath>
instead, and it won't append the configuration name (and as you said, add<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
and<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
to disable appending target framework and runtime identifier).As an example, I have the following in a
<PropertyGroup>
in a C# project:For a debug build, this will output the build files to
<SolutionDir>\Build\Debug\Plugins
.