Windows - ms-vscode.csharp-1.2.2 - installation fails
See original GitHub issueEnvironment data
dotnet --info
output:
.NET Command Line Tools (1.0.0-preview3-003180)
Product Information:
Version: 1.0.0-preview3-003180
Commit SHA-1 hash: d4193cd5c1
Runtime Environment:
OS Name: Windows
OS Version: 6.3.9600
OS Platform: Windows
RID: win81-x64
VS Code version: 1.3.1 C# Extension version: 1.2.2
Steps to reproduce
- Install VS Code & C# extension
- Close VS Code
- dotnet new
- code .
Expected behavior
The coreclr debugger installs itself
Actual behavior
Error message: Error while installing .NET Core Debugger.
coreclr-debug
output
Creating C:\Users\neilhuiz\.vscode\extensions\ms-vscode.csharp-1.2.2\coreclr-debug\project.json
Telemetry is: Enabled
log : Restoring packages for C:\Users\neilhuiz\.vscode\extensions\ms-vscode.csharp-1.2.2\coreclr-debug\project.json...
error: System.Linq 4.1.0 provides a compile-time reference assembly for System.Linq on .NETCoreApp,Version=v1.0, but there is no run-time assembly compatible with win7-x64.
error: System.Security.Cryptography.Algorithms 4.2.0 provides a compile-time reference assembly for System.Security.Cryptography.Algorithms on .NETCoreApp,Version=v1.0, but there is no run-time assembly compatible with win7-x64.
error: System.AppContext 4.1.0 provides a compile-time reference assembly for System.AppContext on .NETCoreApp,Version=v1.0, but there is no run-time assembly compatible with win7-x64.
error: System.Linq.Expressions 4.1.0 provides a compile-time reference assembly for System.Linq.Expressions on .NETCoreApp,Version=v1.0, but there is no run-time assembly compatible with win7-x64.
error: System.Security.Cryptography.X509Certificates 4.1.0 provides a compile-time reference assembly for System.Security.Cryptography.X509Certificates on .NETCoreApp,Version=v1.0, but there is no run-time assembly compatible with win7-x64.
error: System.Text.RegularExpressions 4.1.0 provides a compile-time reference assembly for System.Text.RegularExpressions on .NETCoreApp,Version=v1.0, but there is no run-time assembly compatible with win7-x64.
error: One or more packages are incompatible with .NETCoreApp,Version=v1.0 (win7-x64).
info : Committing restore...
log : Lock file has not changed. Skipping lock file write. Path: C:\Users\neilhuiz\.vscode\extensions\ms-vscode.csharp-1.2.2\coreclr-debug\project.lock.json
log : C:\Users\neilhuiz\.vscode\extensions\ms-vscode.csharp-1.2.2\coreclr-debug\project.json
log : Restore failed in 2468ms.
Error:
Errors in C:\Users\neilhuiz\.vscode\extensions\ms-vscode.csharp-1.2.2\coreclr-debug\project.json
System.Linq 4.1.0 provides a compile-time reference assembly for System.Linq on .NETCoreApp,Version=v1.0, but there is no run-time assembly compatible with win7-x64.
System.Security.Cryptography.Algorithms 4.2.0 provides a compile-time reference assembly for System.Security.Cryptography.Algorithms on .NETCoreApp,Version=v1.0, but there is no run-time assembly compatible with win7-x64.
System.AppContext 4.1.0 provides a compile-time reference assembly for System.AppContext on .NETCoreApp,Version=v1.0, but there is no run-time assembly compatible with win7-x64.
System.Linq.Expressions 4.1.0 provides a compile-time reference assembly for System.Linq.Expressions on .NETCoreApp,Version=v1.0, but there is no run-time assembly compatible with win7-x64.
System.Security.Cryptography.X509Certificates 4.1.0 provides a compile-time reference assembly for System.Security.Cryptography.X509Certificates on .NETCoreApp,Version=v1.0, but there is no run-time assembly compatible with win7-x64.
System.Text.RegularExpressions 4.1.0 provides a compile-time reference assembly for System.Text.RegularExpressions on .NETCoreApp,Version=v1.0, but there is no run-time assembly compatible with win7-x64.
One or more packages are incompatible with .NETCoreApp,Version=v1.0 (win7-x64).
NuGet Config files used:
C:\Users\neilhuiz\.vscode\extensions\ms-vscode.csharp-1.2.2\coreclr-debug\NuGet.config
Feeds used:
https://api.nuget.org/v3/index.json
dotnet exited with error code 1
Mitigation/Possible solution
I tried working around the issue by manually editing the coreclr-debug project.json. I modified the frameworks node to look like:
"frameworks": {
"netcoreapp1.0": {
"imports": [
"netstandard1.6",
"dnxcore50",
"portable-net45+win8"
]
}
},
After this, dotnet restore
succeeds, but the next time I start code
, it just replaces the contents and fails again. I then hunted down the source of that file in %USERPROFILE%\.vscode\extensions\ms-vscode.csharp-1.2.2\out\coreclr-debug\install.js
and modified the file at line 175 (DebugInstaller.prototype.createProjectJson()
):
frameworks: {
"netcoreapp1.0": {
imports: [ "netstandard1.6", "dnxcore50", "portable-net45+win8"]
}
},
Upon restarting the vscode process, installation succeeded.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
VSCode can't detect the installation only when ...
The error seems to be that it can't detect visual studio code, even though it is certainly installed. This is exclusive to installing...
Read more >Workaround for Omnisharp not downloading in VS Code issue
Open the download. · From the Omnisharp log under VS Code's output window you can pick up the file it tries to download...
Read more >PSA: If your VS Code C# extension stopped working...
Click the gear button on C# extension and choose install another version. I use v.
Read more >May 2016 (version 1.2) - Visual Studio Code
To fix several performance and Git integration issues, we're releasing a 1.2.1 recovery build. You can view the resolved issues here. Downloads: Windows...
Read more >How to Run C# in Visual Studio Code on Windows 10 2022
Run csharp and .NET program in visual studio code on windows Hey, guys in this video I'm going to show you how you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Root cause was an installation of the preview 1 SDK which was causing incorrect behavior in
dotnet restore
.That got me somewhere. Here’s what appears to be the relevant output as seen on the console running OpenDebugAD7.exe:
I verified that
System.Reflection.Emit.Lightweight.dll
is not present in the directory. I went back to%userprofile%\.vscode\extensions\ms-vscode.csharp-1.2.2\coreclr-debug
and edited project.json to include"System.Reflection.Emit.Lightweight": "4.0.0"
in the dependencies.After that, I ran
dotnet restore && dotnet publish -o debugAdapters
. Finally, I restartedOpenDebugAD7.exe
per your instructions and was able to start a debugging session. I also verified that I was also able to hit a breakpoint in my code!I also returned my launch.json to its original state and verified that the debugger launches properly and attaches and all that jazz. If you all would like, I can resubmit my PR #576 to include a fix for this as well.