cs-script
cs-script copied to clipboard
Installation Failed Because of Missing .Net Framework
I'm using Linux 20.04. I've already installed .Net 7.0.10
. However, when I try to install and unpack cs-script, it gives me warning messages on missing .Net framework.
Error message:
Preparing to unpack cs-script_4.2-0.deb ...
You must install or update .NET to run this application.
App: /usr/local/bin/cs-script/cscs
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '5.0.0' (x64)
.NET location: /usr/share/dotnet
The following frameworks were found:
7.0.10 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x64&rid=ubuntu.20.04-x64
Unpacking cs-script (4.2-0) over (4.2-0) ...
Setting up cs-script (4.2-0) ...
You must install or update .NET to run this application.
App: /usr/local/bin/cs-script/cscs
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '5.0.0' (x64)
.NET location: /usr/share/dotnet
The following frameworks were found:
7.0.10 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x64&rid=ubuntu.20.04-x64
You must install or update .NET to run this application.
App: /usr/local/bin/cs-script/cscs
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '5.0.0' (x64)
.NET location: /usr/share/dotnet
The following frameworks were found:
7.0.10 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.0&arch=x64&rid=ubuntu.20.04-x64
dpkg: error processing package cs-script (--install):
installed cs-script package post-installation script subprocess returned error exit status 150
Errors were encountered while processing:
cs-script
I've check the intallation of .Net 7.0.10
by dotnet --info
.
It gives me:
`.NET SDK:
Version: 7.0.400
Commit: 73bf45718d
Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-x64
Base Path: /usr/share/dotnet/sdk/7.0.400/
Host:
Version: 7.0.10
Architecture: x64
Commit: a6dbb800a4
.NET SDKs installed:
7.0.400 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.10 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.10 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found`
Does anyone know why? Thanks for any comment!
The problem is caused by missing the required SDK (v5.0). Even though a newer one is found.
Solution (either of):
- install cs-script_4.8-1.deb (depends on SDK v7.0.*)
My preferred way of installing cs-script on Linux is, in fact, as .NET tool (
dotnet tool install --global cs-script.cli
). However in this case you will need to manually add alias (alias css='dotnet /usr/local/bin/cs-script/cscs.dll'+
) - install older SDK .5.0