Directory.Build.props 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <Project>
  2. <Import Project="$(MSBuildThisFileFullPath).user" Condition="Exists('$(MSBuildThisFileFullPath).user')" />
  3. <!--
  4. Assembly Info properties that apply to all projects/assemblies.
  5. -->
  6. <PropertyGroup>
  7. <IsPackable>false</IsPackable>
  8. <SignAssembly>true</SignAssembly>
  9. <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Renci.SshNet.snk</AssemblyOriginatorKeyFile>
  10. <GenerateDocumentationFile>true</GenerateDocumentationFile>
  11. <EnablePackageValidation>true</EnablePackageValidation>
  12. <LangVersion>latest</LangVersion>
  13. <WarningLevel>9999</WarningLevel>
  14. </PropertyGroup>
  15. <PropertyGroup Condition="'$(Configuration)' == 'Release' Or '$(CI)' != ''">
  16. <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
  17. </PropertyGroup>
  18. <!--
  19. Code analysis properties.
  20. -->
  21. <PropertyGroup>
  22. <EnableNETAnalyzers>true</EnableNETAnalyzers>
  23. <AnalysisLevel>preview-All</AnalysisLevel>
  24. <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
  25. </PropertyGroup>
  26. <!-- don't treat NuGet Audit warnings as errors -->
  27. <PropertyGroup>
  28. <WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
  29. </PropertyGroup>
  30. <!--
  31. Disable nullable warnings on old frameworks because of missing annotations.
  32. -->
  33. <PropertyGroup Condition=" !$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0')) ">
  34. <NoWarn>$(NoWarn);CS8602;CS8604;CS8777</NoWarn>
  35. </PropertyGroup>
  36. <!--
  37. Add the stylecop config to each project.
  38. -->
  39. <ItemGroup>
  40. <AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" Visible="false" />
  41. </ItemGroup>
  42. <!--
  43. Use fixed version of analyzers.
  44. -->
  45. <ItemGroup>
  46. <PackageReference Include="StyleCop.Analyzers" PrivateAssets="all" />
  47. <PackageReference Include="Meziantou.Analyzer" PrivateAssets="all" />
  48. <PackageReference Include="SonarAnalyzer.CSharp" PrivateAssets="all" />
  49. </ItemGroup>
  50. </Project>