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

[BUG] always request downloading .NET Runtime #562

Closed
imokoi opened this issue Sep 26, 2023 · 19 comments
Closed

[BUG] always request downloading .NET Runtime #562

imokoi opened this issue Sep 26, 2023 · 19 comments
Labels
area-sdk area-unity Unity support bug Something isn't working mac MacOS needs-more-info Needing more information, waiting on OP

Comments

@imokoi
Copy link

imokoi commented Sep 26, 2023

Describe the Issue

visualstudiotoolsforunity.vstuc requested to download the .NET Runtime.
Downloading .NET version(s) 7.0.11~arm64 ...

Steps To Reproduce

No response

Expected Behavior

No response

Environment Information

macOS , VSCode

@imokoi imokoi added the bug Something isn't working label Sep 26, 2023
@webreidi webreidi added area-unity Unity support mac MacOS labels Sep 26, 2023
@anray156
Copy link

same issue

@jbevain
Copy link
Member

jbevain commented Oct 11, 2023

@imokoi is this still happening on the latest versions of the C# and C# Dev Kit extensions?

@atship
Copy link

atship commented Oct 13, 2023

same issue occurs on windows 10 with the lastest version of VSCode
Downloading .NET version(s) 7.0.12~x64 now

Edit:
I found dotnet/vscode-dotnet-runtime#1263 (comment) and fix the issue

@zhengying
Copy link

zhengying commented Oct 13, 2023

same issue
@atship no effect here, I had already added that setting item.

"dotnetAcquisitionExtension.existingDotnetPath": [
    
    
    {
        "extensionId": "ms-dotnettools.csdevkit",
        "path": "/usr/local/share/dotnet/dotnet"
    },
    {
        "extensionId": "ms-dotnettools.vscodeintellicode-csharp",
        "path": "/usr/local/share/dotnet/dotnet"
    },
    {
        "extensionId": "ms-dotnettools.csharp",
        "path": "/usr/local/share/dotnet/dotnet"
    },
    {
        "extensionId": "ms-dotnettools.vscode-dotnet-runtime",
        "path": "/usr/local/share/dotnet/dotnet"    
    },
    {
        "extensionId": "msazurermtools.azurerm-vscode-tools", 
        "path": "/usr/local/share/dotnet/dotnet"
    }
]

@roymina
Copy link

roymina commented Oct 14, 2023

btw, settings for windows users:

"dotnetAcquisitionExtension.existingDotnetPath": [
        {
            "extensionId": "ms-dotnettools.csharp",
            "path": "C:\\Program Files\\dotnet\\dotnet.exe"
        },
        {
            "extensionId": "ms-dotnettools.csdevkit",
            "path": "C:\\Program Files\\dotnet\\dotnet.exe"
        },
        {
            "extensionId": "visualstudiotoolsforunity.vstuc",
            "path": "C:\\Program Files\\dotnet\\dotnet.exe"
        }
    ],

@thomasbergersen
Copy link

Even if the path is set correctly, a.NET Runtime window message pops up every time you restart. How do I turn it off

@nagilson
Copy link
Member

nagilson commented Nov 1, 2023

@zhengying Are you using the unity extension? If so, you also need to set it for the visualstudiotoolsforunity.vstuc extension id.

If the download is failing, it would be good to have logs from the failure so we could try to fix it. These logs would have already been deleted by this point, but when you see the failure, there should be an error in the bottom right corner like @thomasbergersen mentions. If you click to report an issue, it will take you to a github issue page and tell you were the log is you need to submit.

@arkalyanms arkalyanms added the needs-more-info Needing more information, waiting on OP label Nov 16, 2023
@lifengl
Copy link
Member

lifengl commented Nov 20, 2023

C# Dev Kit would download dotnet runtime, if it cannot find NET 7 SDK installed on the machine, so installing NET 7 SDK, and ensure it to be resolvable through the PATH environment. On Mac, also make sure that you do not turn on an option to work with ad-hoc/test version SDK. The extension will always download its own stable version of runtime, if this option is turned on. The option is only for a small set of developers who wok on daily SDK builds, and should not be turned on in common developing environment.

@Gonkers
Copy link

Gonkers commented Nov 21, 2023

C# Dev Kit would download dotnet runtime, if it cannot find NET 7 SDK installed on the machine, so installing NET 7 SDK, and ensure it to be resolvable through the PATH environment. On Mac, also make sure that you do not turn on an option to work with ad-hoc/test version SDK. The extension will always download its own stable version of runtime, if this option is turned on. The option is only for a small set of developers who wok on daily SDK builds, and should not be turned on in common developing environment.

This is quite annoying as I have the .NET 8 SDK installed. 🫤

@lifengl
Copy link
Member

lifengl commented Nov 27, 2023

It doesn't have to be a full NET 7 SDK, I believe installing NET 7 runtime to the global location would be good enough. Installing SDK is just an easy way to ensure it is there. In any case, different versions of SDKs or runtimes can be installed side by side, so it should not affect the usage of NET 8 SDK.

On the other hand, once the auto-download code downloads one copy successfully, it should reuse it in the next session. However, it would download a new version every time an update comes in. This is not controlled by the extension.

Most executables in the extensions are only tested against NET 7 runtime, and they are restricted to only run with NET 7 runtime, but not the NET 8 runtime. The problem here is that the SDK installed is to be used to build/run your application, but the C# extension itself is a NET Core application, which has its own runtime requirement.

Although NET 8 runtime is mostly backward compatible to NET 7 runtime, some behaviors are different, so it is not guaranteed that things will work as expected with proper testing.

This is quite annoying as I have the .NET 8 SDK installed. 🫤

@alexandrearc
Copy link

Was this bug introduced recently ? I didn't have this issue few months ago but I am having now..

@Gonkers
Copy link

Gonkers commented Dec 2, 2023

It doesn't have to be a full NET 7 SDK, I believe installing NET 7 runtime to the global location would be good enough. Installing SDK is just an easy way to ensure it is there. In any case, different versions of SDKs or runtimes can be installed side by side, so it should not affect the usage of NET 8 SDK.

On the other hand, once the auto-download code downloads one copy successfully, it should reuse it in the next session. However, it would download a new version every time an update comes in. This is not controlled by the extension.

Most executables in the extensions are only tested against NET 7 runtime, and they are restricted to only run with NET 7 runtime, but not the NET 8 runtime. The problem here is that the SDK installed is to be used to build/run your application, but the C# extension itself is a NET Core application, which has its own runtime requirement.

Although NET 8 runtime is mostly backward compatible to NET 7 runtime, some behaviors are different, so it is not guaranteed that things will work as expected with proper testing.

This is quite annoying as I have the .NET 8 SDK installed. 🫤

Thanks for the response, I understand. Nothing is ever as simple as it seems from the outside.

kosperera pushed a commit to alertbox/try-dotnet-on-azure that referenced this issue Dec 10, 2023
… for c# and .net (#12)

this changeset is to upgrade the dev container to use the latest .net
8.0 version along with azure.

- use the .net 8.0 bookworm slim docker image
- remove redundant vs code extensions because the correct extensions are
added by the dev container features
- remove outdated and unwanted vs code customization settings
- fix terraform not getting installed due to issue
hashicorp/vscode-terraform#1524
- stop using c# dev kit extension due to issue
microsoft/vscode-dotnettools#562
- turn off telemetry for dapr and dotnet
- docs: reword, simplify, and improve README.md content
@IntelHeartPrime
Copy link

IntelHeartPrime commented Dec 18, 2023

Thanks , I had fixed it

"dotnetAcquisitionExtension.existingDotnetPath": [
    {
        "extensionId": "msazurermtools.azurerm-vscode-tools",
        "path": "/usr/local/share/dotnet/dotnet"
    },
    {
        "extensionId": "visualstudiotoolsforunity.vstuc",
        "path": "/usr/local/share/dotnet/dotnet"
    }
]

Add the " visualstudiotoolsforunity.vstuc " to config file

@netcore-jroger
Copy link

I added the following code and got it to work:

"dotnetAcquisitionExtension.existingDotnetPath": [
    {
        "extensionId": "tintoy.msbuild-project-tools",
        "path": "C:\\Program Files\\dotnet\\dotnet.exe"
    }
]

@usamino
Copy link

usamino commented Jan 15, 2024

When I open it from the Unity project, an error occurs, but when I open the project from the vscode open button, it works fine.
Can you all try it?

@Zanbrachrissik
Copy link

Thanks , I had fixed it

"dotnetAcquisitionExtension.existingDotnetPath": [
    {
        "extensionId": "msazurermtools.azurerm-vscode-tools",
        "path": "/usr/local/share/dotnet/dotnet"
    },
    {
        "extensionId": "visualstudiotoolsforunity.vstuc",
        "path": "/usr/local/share/dotnet/dotnet"
    }
]

Add the " visualstudiotoolsforunity.vstuc " to config file

This is what I need. And I figured out that the extensionId is the name of the package. So once you find some other packages keep requesting for downloading, add their name and it works like a charm.

Copy link

This issue has been automatically closed due to inactivity from original bug filer and having the 'needs-more-info' label for more than 14 days. If the issue still persists, please reopen the issue with the requested information.

@MichelGhaith
Copy link

i tried all your solutions and nothing work with me.

@nagilson
Copy link
Member

nagilson commented May 1, 2024

@MichelGhaith please submit a new issue with more details at https://github.com/dotnet/vscode-dotnet-runtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-sdk area-unity Unity support bug Something isn't working mac MacOS needs-more-info Needing more information, waiting on OP
Projects
None yet
Development

No branches or pull requests