Directory.Build.props 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. <LangVersion>latest</LangVersion>
  12. <WarningLevel>9999</WarningLevel>
  13. </PropertyGroup>
  14. <PropertyGroup Condition="'$(Configuration)' == 'Release' Or '$(CI)' != ''">
  15. <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
  16. </PropertyGroup>
  17. <!--
  18. Code analysis properties.
  19. -->
  20. <PropertyGroup>
  21. <EnableNETAnalyzers>true</EnableNETAnalyzers>
  22. <AnalysisLevel>preview-All</AnalysisLevel>
  23. <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
  24. </PropertyGroup>
  25. <!-- don't treat NuGet Audit warnings as errors -->
  26. <PropertyGroup>
  27. <WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
  28. </PropertyGroup>
  29. <!--
  30. Disable nullable warnings on old frameworks because of missing annotations.
  31. -->
  32. <PropertyGroup Condition=" !$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0')) ">
  33. <NoWarn>$(NoWarn);CS8602;CS8604;CS8777</NoWarn>
  34. </PropertyGroup>
  35. <!--
  36. Add the stylecop config to each project.
  37. -->
  38. <ItemGroup>
  39. <AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" Visible="false" />
  40. </ItemGroup>
  41. <!--
  42. Use fixed version of analyzers.
  43. -->
  44. <ItemGroup>
  45. <PackageReference Include="StyleCop.Analyzers" PrivateAssets="all" />
  46. <PackageReference Include="Meziantou.Analyzer" PrivateAssets="all" />
  47. <PackageReference Include="SonarAnalyzer.CSharp" PrivateAssets="all" />
  48. </ItemGroup>
  49. </Project>