walterlv / BlogComments

3 stars 0 forks source link

post/the-properties-that-affetcs-project-output-path #158

Open utterances-bot opened 5 months ago

utterances-bot commented 5 months ago

如何更精准地设置 C# / .NET Core 项目的输出路径?(包括添加和删除各种前后缀) - walterlv

我们都知道可以通过在 Visual Studio 中设置输出路径(OutputPath)来更改项目输出文件所在的位置。对于 .NET Core 所使用的 Sdk 风格的 csproj 格式来说,你可能会发现实际生成路径中带了 netcoreapp3.0 或者 net472 这样的子文件夹。 然而有时我们并不允许生成这样的子文件夹

https://blog.walterlv.com/post/the-properties-that-affetcs-project-output-path.html

prime167 commented 5 months ago
<PropertyGroup>
  <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<PropertyGroup>
  <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
</PropertyGroup>

https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#appendtargetframeworktooutputpath