After creating a NuGet package as part of my build pipeline, I opened the NuGet package through the NuGet Package explorer to doublecheck if everything is ok.
Unfortunately I got the following warning in the Compiler Flags section:
Present, not reproducible
When I hovered over the warning icon, I got the following extra information:
Ensure you’re using at least the 5.0.300 SDK or MSBuild 16.10
The reason I got this error is that on the build server a newer .NET 5 SDK was installed and used to build this package.
I could easily verify this by calling the following command :
dotnet --list-sdks
The output should show something like this:
5.0.204 [C:\Program Files\dotnet\sdk]
As you can see I didn’t have the 5.0.300 SDK installed. Fixing it can be done by either updating Visual Studio to the latest version or installing the latest .NET SDK.