参考资料

.csproj

  1. <Project Sdk="Microsoft.NET.Sdk.Web">
  2. <PropertyGroup>
  3. <TargetFramework>net6.0</TargetFramework>
  4. <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
  5. <DockerfileContext>..\..</DockerfileContext>
  6. <IncludeSymbolsInSingleFile>true</IncludeSymbolsInSingleFile>
  7. <ServerGarbageCollection>false</ServerGarbageCollection>
  8. <ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
  9. <Platforms>AnyCPU;ARM64</Platforms>
  10. <AssemblyVersion>3.0.*</AssemblyVersion>
  11. <OutputPath>..\..\..\..\9.published\WebApiUI\</OutputPath>
  12. <DocumentationFile>..\..\..\..\9.published\temp\xml\$(MSBuildProjectName).xml</DocumentationFile>
  13. <NoWarn>1701;1702;1591</NoWarn>
  14. </PropertyGroup>
  15. <PropertyGroup>
  16. <!-- 指定的版本字符串中包含与确定性不兼容的通配符 -->
  17. <GenerateAssemblyInfo>False</GenerateAssemblyInfo>
  18. <Deterministic>False</Deterministic>
  19. </PropertyGroup>
  20. </Project>

生成路径中包括框架和运行时

  1. <PropertyGroup>
  2. <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
  3. <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
  4. </PropertyGroup>