Skip to content
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

dotnet script doesn't obey version #622

Closed
phatcher opened this issue May 23, 2021 · 1 comment
Closed

dotnet script doesn't obey version #622

phatcher opened this issue May 23, 2021 · 1 comment

Comments

@phatcher
Copy link

I'm trying to run a script as NET Core 3.1 but dotnet script main.csx is not obeying the version, at the top of my file I have

#! "netcoreapp3.1"

and in lauch.json I have

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Script Debug",
            "type": "coreclr",
            "request": "launch",
            "program": "dotnet",
            "args": [
                "exec",
                "${env:USERPROFILE}/.dotnet/tools/.store/dotnet-script/1.1.0/dotnet-script/1.1.0/tools/netcoreapp3.1/any/dotnet-script.dll",
                "${file}"
            ],
            "cwd": "${workspaceRoot}",
            "stopAtEntry": true
        }
    ]
}

My ```dotnet script --info`` reports

Version             : 1.1.0
Install location    : C:\Users\paulh\.dotnet\tools\.store\dotnet-script\1.1.0\dotnet-script\1.1.0\tools\net5.0\any
Target framework    : net5.0
.NET Core version   : 5.0.6
Platform identifier : win
Runtime identifier  : win10-x64

The script is old and can't run as .NET 5.0 as most of the referenced nuget packages do not support it. There are netcoreapp2.1 and netcoreapp3.1 directories as well as the net5.0 in the dotnet-script folder which suggests this si supported?

@seesharper
Copy link
Collaborator

The #! "netcoreapp3.1" won't work here. It was an early attempt to communicate to Omnisharp that we wanted compilation dependencies for a given target framework. It has never been used to resolve runtime dependencies for dotnet-script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants