I am currently using C#-script as a part of infrastructure and would like to tightly control what version of the .NET SDK is used to compile scripts. The C#-script version I am using runs under the .NET 8 runtime, and thus I expected it to always use the .NET 8 SDK to compile scripts. This, however, is not the case. If the .NET 9 SDK is installed, then that SDK is used instead.
This is a problem because some scripts can be compiled using the .NET 8 SDK but not with the .NET 9 SDK, so I want a very specific version to be used.
I cannot seem to find a way to do this. To my understanding, .NET usually lets you specify an SDK version using global.json next to your project. I also noticed that C#-script creates an entire VS solution and .csproj file in a temp directory to compile these scripts.
Is there ANY way to set the SDK version to use on the command line? Perhaps something that would create a global.json file in that temp directory where the script gets compiled?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4