-
Notifications
You must be signed in to change notification settings - Fork 271
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
8.0.10 Runtime Failed - NET: The requested and or resolved version is invalid. #2021
Comments
I encountered the same issue due to the .NET Install Tool extension. According to its documentation,
Therefore, my suggestion is that some of your C# extensions might be assuming that your current version of .NET SDK is outdated (this is just an assumption). https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.vscode-dotnet-runtime |
I had the same (apparently) error in Visual Studio Code today and I have MacOS Sonoma 14.5, maybe a coincidence, or not. I solved it reinstalling dotnet. |
x2 @manueljtala I have the same problem. |
Ok...I thought that the problem was solved, but now vscode doesn't detect the project, I cannot navigate to classes, find references...etc |
Same issue here. An easy temporary fix that worked for me is to downgrade the newly updated C# extension as described here. |
This safe me. I checked the c# extension and noticed it updated itself like 16hrs ago. have to rollback to version 2.50 |
Same, had to rollback, this is definitely an issue. |
Im having this problem too. Had to rollback to older version |
Hi! I am the maintainer of this extension, so I'm gonna provide you some answers. Sorry for all of this hassle. Work Around❗ This has been fixed in the new release of the C# extension, version 2.55.29. Please try to get to that version, first. Install the 8.0 SDK using the '.NET Install Tool - Install SDK Command', and or, rollback C# extension to version to 2.50.27 (Click on the down arrow next to uninstall button from extension details page). In the coming days, make sure to re-enable extension updates so you get future bug fixes. Video from @peyronth here as to how: #2022 (comment) 385691723-8fbe8cc8-fd61-4a87-a3cf-eae7239f4b33.webmResolutionI'm helping to coordinate a release of C# with an emergency hot fix -- I think the correct fix is in the C# extension, more work would need to be done to properly support Major.Minor.Patch requests and suppressing the error on our side might cause unexpected issues. ExplanationThis is a bug in the C# Extension. It looks like this is exactly it. It passes 8.0.10 to our Runtime Acquisition API, but the way the runtime API is designed is to only support major.minor versions. The SDK API accepts many different formats, and the findPath API is going to support patch versions, but not the acquire runtime API. This is documented here, but it should probably be documented better:
The acquire API will always acquire the 'latest' 8.0 runtime, so I would revert back to that change, as latest is always gonna be 8.0.10 or higher now. Our line of code is here: vscode-dotnet-runtime/vscode-dotnet-runtime-library/src/Acquisition/VersionResolver.ts Line 146 in 99112a0
Our data mechanisms show 98.8+ Success Rate for detecting this fault did not get triggered because it counted this as an invalid request. |
Resolves dotnet/vscode-dotnet-runtime#2021 # ! This should be released as a high sev hot-fix release 🔥 This is a bug in the C# Extension. Here is the line of code causing this problem: https://github.com/dotnet/vscode-csharp/blob/eb38986a52a8be7221d0e466f7a25c98dcbd7825/src/lsptoolshost/dotnetRuntimeExtensionResolver.ts#L19 It looks like this is exactly it. It passes 8.0.10 to our Runtime Acquisition API, but the way the runtime API is designed is to only support major.minor versions. The SDK API accepts many different formats, and the findPath API is going to support patch versions, but not the acquire runtime API. This is documented here, but it should probably be documented better: https://github.com/dotnet/vscode-dotnet-runtime/blob/99112a0d6689b1bc01ff9dcf117368ea79c943b5/vscode-dotnet-runtime-library/src/IDotnetAcquireContext.ts#L15 The acquire API will always acquire the 'latest' 8.0 runtime, so I would revert back to that change, as latest is always gonna be 8.0.10 or higher now. Our line of code is here: https://github.com/dotnet/vscode-dotnet-runtime/blob/99112a0d6689b1bc01ff9dcf117368ea79c943b5/vscode-dotnet-runtime-library/src/Acquisition/VersionResolver.ts#L146 Where it rejects the request if its not of the form Major.Minor. Our data mechanisms show 98.8+ Success Rate for detecting this fault did not get triggered because it counted this as an invalid request.
Proposed Fix PR here dotnet/vscode-csharp#7769 |
This guy send updates without a proper testing and/or testing environment |
@nagilson Thanks for the response on this, just a quick note you should add a highlighted section of some sort on your proposed resolution to remind people to re-toggle "Auto Updates" once the fix is merged. Choosing to install a specific version inherently disables "Auto Updates" and could cause issues for users in the future. Just a thought. |
I have a project on .NET 7.1 which works fine on Visual Studio, but getting this error when on vscode. Edit: Downgrade worked. |
Great idea, thank you @adrocic. |
This SDK is for C# to run on, not for your project to run on @naeem76. |
A fix has been released in the C# extension. Updating to the latest version should also now fix this. |
I'll leave this open for a few days as more people will probably get the old version of C# and hit this issue, but then I will close it. If the new version does not fix it for anyone, they could also report so here. |
The versions of the C# extension with the fix are |
Gonna close this as impact now looks minimal, thanks everyone! |
Can confirm latest version fixes this issue for me. |
Information About This Issue
Hi! I am the maintainer of this extension, so I'm gonna provide you some answers. Sorry for all of this hassle.
I've (@nagilson) edited your issue and left your original issue untouched on the bottom.
Work Around
❗ This has been fixed in the new release of the C# extension, version 2.55.29. Please try to get to that version, first.
Install the 8.0 SDK using the '.NET Install Tool - Install SDK Command', and or, rollback C# extension to version to 2.50.27 (Click on the down arrow next to uninstall button from extension details page).
Video from @peyronth here as to how: #2022 (comment)
385691723-8fbe8cc8-fd61-4a87-a3cf-eae7239f4b33.webm
Resolution
I'm helping to coordinate a release of C# with an emergency hot fix -- I think the correct fix is in the C# extension, more work would need to be done to properly support Major.Minor.Patch requests and suppressing the error on our side might cause unexpected issues.
Explanation
This is a bug in the C# Extension.
Here is the line of code causing this problem: https://github.com/dotnet/vscode-csharp/blob/eb38986a52a8be7221d0e466f7a25c98dcbd7825/src/lsptoolshost/dotnetRuntimeExtensionResolver.ts#L19
It looks like this is exactly it. It passes 8.0.10 to our Runtime Acquisition API, but the way the runtime API is designed is to only support major.minor versions. The SDK API accepts many different formats, and the findPath API is going to support patch versions, but not the acquire runtime API. This is documented here, but it should probably be documented better:
vscode-dotnet-runtime/vscode-dotnet-runtime-library/src/IDotnetAcquireContext.ts
Line 15 in 99112a0
The acquire API will always acquire the 'latest' 8.0 runtime, so I would revert back to that change, as latest is always gonna be 8.0.10 or higher now.
Our line of code is here:
vscode-dotnet-runtime/vscode-dotnet-runtime-library/src/Acquisition/VersionResolver.ts
Line 146 in 99112a0
Our data mechanisms show 98.8+ Success Rate for detecting this fault did not get triggered because it counted this as an invalid request.
Original Issue
Describe the bug.
I already installed .net pakcage but i see this error popping up every time i open vs code, by the way this request is done by unity for vs code extension:
An error occurred while installing .NET: The requested and or resolved version is invalid.
Cancelled Installation of .NET 8.0.10.
The requested and or resolved version is invalid.
Cancelled Installation of .NET 8.0.10.
The requested and or resolved version is invalid.
Cancelled Installation of .NET 8.0.10.
The requested and or resolved version is invalid.
Cancelled Installation of .NET 8.0.10.
The requested and or resolved version is invalid.
Cancelled Installation of .NET 8.0.10.
The requested and or resolved version is invalid.
Cancelled Installation of .NET 8.0.10.
The requested and or resolved version is invalid.
visualstudiotoolsforunity.vstuc requested to download the .NET Runtime.
Downloading .NET version(s) 8.0.11~x64 ...Cancelled Installation of .NET 8.0.10.
The requested and or resolved version is invalid.
Cancelled Installation of .NET 8.0.10.
The requested and or resolved version is invalid.
Please attach log file(s) here if you have any.
Please attach the log file located at DotNetAcquisition-ms-dotnettools.vscode-dotnet-runtime-1731471856933.txt
DotNetAcquisition-ms-dotnettools.vscode-dotnet-runtime-1731471856933.txt. Note that this file may contain personal data.
Extension Version: 1.0.0
Error Message: The requested and or resolved version is invalid.
Error Stack: Error: The requested and or resolved version is invalid.
at t.VersionResolver.resolveVersion (c:\Users\anonymous.vscode\extensions\ms-dotnettools.vscode-dotnet-runtime-2.2.2\dist\extension.js:2:114800)
at c:\Users\anonymous.vscode\extensions\ms-dotnettools.vscode-dotnet-runtime-2.2.2\dist\extension.js:2:114261
at new Promise ()
at t.VersionResolver. (c:\Users\anonymous.vscode\extensions\ms-dotnettools.vscode-dotnet-runtime-2.2.2\dist\extension.js:2:114217)
at Generator.next ()
at s (c:\Users\anonymous.vscode\extensions\ms-dotnettools.vscode-dotnet-runtime-2.2.2\dist\extension.js:2:112801)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Reproduction Steps
just open up vs code with requirement installed for unity.
Expected Behavior
it should download it just fine.
Exceptions & Errors (if any)
No response
.NET Install Tool Version
2.2.2
Your operating system? Please provide more detail, such as the version and or distro above.
Windows
VS Code Version
No response
The text was updated successfully, but these errors were encountered: