-
Notifications
You must be signed in to change notification settings - Fork 238
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
Can not run scripts after installing VS2022 #258
Comments
Hi Caelan, sorry for the delay. It was a 4-days weekend in Mel :) That is an interesting problem. Can you please check if forcing it to compile against .NET 5 Roslyn would do the trick:
|
Hi Oleg, thanks for the response.
C:\Users\Caelan>cscs -ng:roslyn "C:\Tools\scripts\locking.cs"
Error: Specified file could not be executed.
Could not load type 'System.Runtime.CompilerServices.DefaultInterpolatedStringHandler' from assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. For reference, this is the list of runtimes I have installed >dotnet --info
NET SDK (reflecting any global.json):
Version: 6.0.100-rc.2.21505.57
Commit: ab39070116
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100-rc.2.21505.57\
Host (useful for support):
Version: 6.0.0-rc.2.21480.5
Commit: 6b11d64e7e
.NET SDKs installed:
5.0.301 [C:\Program Files\dotnet\sdk]
5.0.401 [C:\Program Files\dotnet\sdk]
6.0.100-rc.2.21505.57 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-rc.2.21480.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-rc.2.21480.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-rc.2.21501.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] |
Found the problem when installed .NET 6 SDK. Though not entirely sure that it is absolutely the same as in your environment. While all SDKs installed are fully independent (e.g. their compilers In your case, you may have both SDKs of the same architecture but still, they may not be compatible type wise. I will prepare a hotfix release so you can test the build with the deterministic probing of both csc and dotnet. This may fix the problem. But... if it does not then please send me your exact script as in my environment .NET 6 SDK breaks the execution but with the CPU architecture incompatibility. And Roslyn engine does fix the problem. Meaning that there are differences in between our tests either in our environments or our scripts. Stay tuned |
- Updated `-speed` and `-code` with the complete support `-ng:*` switches - Added `IEvaluator.IsCachingEnabled`. Ite as always available from the conctrete types implementing `IEvaluator` and now it is moved directly to the interface. - Added `-servers:start` and `-servers:stop` command to control both Roslyn and csc build servers at the same time - CSScriptLib: Native API `CacheEnabled` marked as obsolete - Issue #258: Can not run scripts after installing VS2022 - Issue #257: Ability to catch AppDomain.UnhandledException in a not-hosted script (cscs) - Issue #255: Relative path for cscs.exe -out option results in wrong output folder - Issue #254: Script merger for hosted scripts - Issue #253: Supports both .Net Framework and .Net 5 - Issue #252: System.NullReferenceException: Object reference not set to an instance of an object. (updated API doc) - Added auto-generation of the CLI MD documentation with `-help cli:md`. To be used to generate GitHub wiki page during the build - Fixed Debian packaging problem (`/n/r` needed replacement with `\n`)
### Misc - Added auto-generation of the CLI MD documentation with -help cli:md. To be used to generate GitHub wiki page during the build - Fixed Debian packaging problem (/n/r needed replacement with \n) - Issue #253: Supports both .Net Framework and .Net 5 ### CLI - Updated -speed and -code with the complete support -ng:* switches - Added -servers:start and -servers:stop command to control both Roslyn and csc build servers at the same time - Issue #258: Can not run scripts after installing VS2022 - Issue #257: Ability to catch AppDomain.UnhandledException in a not-hosted script (cscs) - Issue #255: Relative path for cscs.exe -out option results in wrong output folder - Issue #254: Script merger for hosted scripts - Issue #252: System.NullReferenceException: Object reference not set to an instance of an object. (updated API doc) ### CSScriptLib - Native API CacheEnabled marked as obsolete - Added IEvaluator.IsCachingEnabled. It is always available from the concrete types implementing IEvaluator and now it is moved directly to the interface.
VS2022 installs the dotnet6 sdk, and this has caused cs-script to fail to execute all scripts, of any kind. I can't see any command line arguments that might be helpful.
Presumably related to some of the changes mentioned here https://devblogs.microsoft.com/dotnet/string-interpolation-in-c-10-and-net-6/
Is there a way to instruct cs-script to use the dotnet 5 runtime that I'm unaware of?
The text was updated successfully, but these errors were encountered: