在传统的.NET应用程序中,可以在.csproj
文件中设置程序集的自定义<OutputPath>
(或通过项目属性对话框)。例如bin\$(Configuration)\$(Platform)
的路径会生成bin\Debug\AnyCPU
。
我习惯于独立设置这些值,与当前的构建配置无关(在自己的ItemGroup
中,连同DocumentationFile
等一起设置)。
当我像这样设置新的.NET core .csproj
配置时......
<OutputPath>bin\$(Configuration)\$(Platform)</OutputPath>
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
以下文件夹结构将被创建:
bin\
Debug\
AnyCPU\
MyAssembly.xml
netstandard1.0\
MyAssembly.exe
看起来msbuild或其他自动添加了TargetFramework
,这相当令人烦恼。
是否有一种方法可以真正自定义输出路径或禁用此行为?
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
- Dave Thieben