docs
docs copied to clipboard
Be explicit about version of .NET framework required for csharp templates
Problem description
I'm updating our getting started tutorials and ran into the problem described here: https://github.com/pulumi/pulumi/issues/5913
Currently, our docs say that you need .NET core 3.1 or later, but if you're starting from a clean machine and create a new project using one of our csharp templates (like azure-csharp
or gcp-csharp
), the latest version of .NET (5.0) will be installed on your machine, which then gives you the following error when running pulumi up
:
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '3.1.0' was not found.
- The following frameworks were found:
5.0.0 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=3.1.0&arch=x64&rid=osx.11.0-x64
error: an unhandled error occurred: Program exited with non-zero exit code: 150
So after I downloaded .NET core 3.1, everything worked as expected. Note: I also tried just changing the target framework to net5.0
and that seemed to work as well.
Suggestions for a fix
I think the best course of action short-term is to be very explicit in the docs that you need to install .NET Core 3.1 and update the text accordingly (rather than telling people to mess with the target framework for their project). Whenever we're ready to move the target framework up, we can update the docs.
@mikhailshilkov what is our actual support matrix on .NET versions? If it's a bug that we don't work on 5.0, I'd love to fix that. But if it's truly not supported and won't be for some time - then we will need to change our statement of supported versions in several places.
We support both .NET Core 3.1 and .NET 5. The issue is that we need to set the correct value in the xproj
file. Related: https://github.com/pulumi/pulumi/issues/5913
The issue is that we need to set the correct value in the xproj file. Related: pulumi/pulumi#5913
Is that something we can fix imminently? Or should we make a docs change to indicate we don't support .NET 5?
We should definitely fix this and support .NET 5. We likely need to detect the framework version or ask the user during pulumi new
.