-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installed .NET version is incompatible. #380
Comments
The range of the .NET versions supporting CS-Script is Currently, the latest version of CS-Script is compiled against .NET 8.0. Thus it cannot fully function on .NET 9. Meaning, that we still have to wait. Or you can downgrade your preview version to .NET v8.* |
I have them both installed. 6-9sdk Why doesn't it switch for me to another version that allows it to function? The user should not have to deal with config script etc if they have a compatible version installed. |
.NET SDK does not have a concept of switching.
There is nothing in cs-script configuration that you can use to achieve what you want. To load .NET9 compiled script (assembly) into .NET8 compiled script engine. What you are experiencing is a logical problem multiple .NET versions installed on the target system. I assist cs-script users by immediately releasing new cs-script build when a new version of .NET is released. But until it is available I have to wait. I cannot exclude that there is a routing setting somewhere in config file that can force Saying that, cs-script comes with one compiling engine that is independent on the version of .NTE . Roslyn. css -ng:roslyn script.cs
#or
dotnet cscs.dll -ng:roslyn script.cs Most likely it will work. Though Roslyn has some limitations. It can only work with static main and does not allow declaring namespaces: This is the sample code that works: //css_engine roslyn
using System;
public static void Main()
{
Console.WriteLine("Hello World!");
} Saying that I am willing to have a look at the exact problem and see if there is some work around (even though unlikely). So I am changing this issue to |
I have done some investigation and it turns out that there is a relatively straightforward way of changing the target runtime for the script engine to the runtimes higher than the one that the engine was compiled for. I will provision it in the next release distributable package. The dev experience will be something like this: # set current runtime version for the script engine assembly
css -set-rt-self
# set current runtime version for the given assembly
css -set-rt <assembly file> As for you, you don't have to wait for the release and you can manually update your latest CS-Script deployment to work on .NET9.0-Preview. If you are using CS-Script with some of IDEs that it is integrated with then you need to repeat the same for the |
Not sure but it looks like you are using Sublime. |
Wow thanks! Yes I am using sublime. I made the changes to C:\ProgramData\chocolatey\lib\cs-script\tools\cscs.runtimeconfig.json, but I still get this:
I can just roll back to .net 9.0, I just wanted to check out what was coming and all, it's not a biggy. If it's easy to make the other changes I think that other people coming along might benefit from it also but it might not be very popular to use the beta versions honestly. |
The above example script run and compiles fine, so I don't see any reason to bother you further. Thank you, you make an awesome product keep up the good work! |
Technically speaking it is an intended behaviour as the plugin is build for version 6.0.0(inclusive) - 9.0.0(exclusive).
|
It seemed to still work fine for me, so maybe put "Defaulting to x.x version" or some such. That message makes it seem like it's broken. |
correct. the message is misleading.
Will do the change in the next release |
Thanks! Keep up the good work man. |
Upgraded to .Net 9.0.100-preview.6.24328.19 now when I start up sublime I get:
The text was updated successfully, but these errors were encountered: