-
Notifications
You must be signed in to change notification settings - Fork 677
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
Debugging on Windows fails with "Could not load host policy library" #143
Comments
@DustinCampbell Though you were thorough with your reproduction steps you stopped short from detailing how to configure Also, what's your |
I actually didn't stop short. This step automatically generates a launch.json:
Note that these same steps work perfectly on OS X. They fail on Windows. |
And note that
|
Interesting... I didn't get a prompt to add required build and debug assets on Win10 or OS X. I usually CTRL-F5 or fn+F5 and that asks me to add the |
@DustinCampbell Again, I might be missing something because I've only managed to get VS Code debugging by manually configuring the FWIW... I am able to debug the a |
You won't get that prompt unless you install the latest C# extension per my instructions. You need to follow the installation steps I provided. You also likely need to uninstall old versions of the .NET Core SDK and CLI and possibly delete old versions of the C# extension for VS Code. If you have to configure something to make this work, it's not right. Using the latest bits, this should work with no configuration. |
My apologies. OS X is my primary machine for the dotnet CLI bits, I just try things out on Win 10 when I run into issues - still on 0.3.7 of the C# plugin. I'll actually try to repro the issue now. 😳 |
😄 |
Be sure to change your "csharp.omnisharp" preference to not use your own custom OmniSharp if you have that set. |
Indeed I am also getting this error on Windows 10. 😞 Fortunately, all is well in OS X world 😄 Go figure. |
@DustinCampbell does the app run for if you just try doing it manually? I noticed that your steps are missing a 'dotnet restore'. But I am not sure why the build succeeds, so maybe you did that and just didn't mention it? |
@gregg-miskelly, "dotnet restore" happens automatically within OmniSharp if it's missing. |
@gregg-miskelly: and yes, it runs and prints "Hello World" when running it with |
@miguellira, thanks for verifying! |
The issue is that dotnet.exe doesn’t like the fact that the slashes are going the 'wrong' way on Windows. You can work around it by modifying your launch.json to replace ‘/’ with ‘\’. I will change our code to do so automatically. |
That's totally it @gregg-miskelly. 😄 |
What's the workflow when you change the target fx - say from Right now the extension creates the |
No, if you update it, you would need to manually change launch.json. |
(Obviously you could also delete launch.json and have VS Code re-create it) |
I was thinking about ways we might address that some point, but it's tricky to get right. |
For closure: the (bidirectional) fix for the slash issue was approved for Escrow. |
This checkin updates the version of OpenDebugAD7 used by the C# extension to the lastest build. This has a fix for dotnet#143. This also updates the package version to 1.0.0-rc2.
Fix launch on Windows with forward slashes in program (#143)
This checkin updates the version of OpenDebugAD7 used by the C# extension to the lastest build. This has a fix for dotnet#143. This also updates the package version to 1.0.0-rc2.
Repro Steps:
At the command line:
dotnet new
to create new projectcode .
to open newly-created project in VS CodeIn VS Code:
"debugType": "portable"
to"compilationOptions"
sectionConsole.WriteLine("Hello World!");
Expected Result:
Project compiles, runs, and breakpoint is hit.
Actual Result:
Project compiles but breakpoint is not hit. Instead, the following text appears in the Debug Console:
The text was updated successfully, but these errors were encountered: