VS Library - csproj Contents
Here are some standard things for the csproj file of a .NET library project.
The top Property Group should list the following things:
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PackageId>OGA.NugetRepoClient.Lib</PackageId>
<Product>OGA Nuget Repository Client Library</Product>
<Description>Wrapper library for Nuget Repository client usage.</Description>
<RootNamespace>OGA.NugetRepoClient</RootNamespace>
<AssemblyName>OGA.NugetRepoClient.Lib</AssemblyName>
<Version>1.0.0</Version>
<AssemblyVersion>1.0.1.0</AssemblyVersion>
<FileVersion>1.0.1.0</FileVersion>
<Company>OGA</Company>
<Authors>Lee White</Authors>
<Configurations>DebugWin;ReleaseWin;DebugLinux;ReleaseLinux</Configurations>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
Special for .NET5
If the project is for .NET5, be sure to add the warning suppression from this page: VS IDE Suppress Compiler Warnings Project Wide
OS-Based Conditional Source Code
If the library uses conditional compilation statements (preprocessor directives) to suppress or enable source code for different OS targets, you will need to add these additional property groups:
<PropertyGroup Condition="$(Configuration.EndsWith('Win'))">
<DefineConstants>$(DefineConstants);Windows</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(Configuration.EndsWith('Linux'))">
<DefineConstants>$(DefineConstants);Linux</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(Configuration.EndsWith('OSX'))">
<DefineConstants>$(DefineConstants);OSX</DefineConstants>
</PropertyGroup>