Terminal: "Windows Terminal" app package cannot be debugged in default VS configuration

Created on 11 May 2019  Â·  11Comments  Â·  Source: microsoft/terminal

If anyone can help me get started, I can't seem to get debugging to work in VS2019. I am able to build, run and deploy the app, however, any breakpoints I set don't work when I try to debug with F5 (I saw @miniksa on youtube debug, so I know it should work).

When I stop/terminate debugging I get the following:
image
Perhaps this is related?

  • Windows build number: 10.0.18362.86
  • VS 2019 16.0.3 (Community)
Area-Build Issue-Bug Resolution-External

Most helpful comment

This problem _haunts_ us. The secret is something you'd never expect, and something that belongs in our getting started guide.

Go to the properties for the _CascadiaPackage_ project, choose Debug, and change the project type from "_Mixed (Managed and Native)_" to "_Native Only_".

All 11 comments

This problem _haunts_ us. The secret is something you'd never expect, and something that belongs in our getting started guide.

Go to the properties for the _CascadiaPackage_ project, choose Debug, and change the project type from "_Mixed (Managed and Native)_" to "_Native Only_".

Can you explain why this happens in more detail than the Error thrown provides?

Sure. The “Windows app packaging” project type (wapproj) in the Visual Studio project system is a derivative of the C# project type csproj. Owing to that, VS assumes that by default any application launched from WAP projects will start up the CLR.

Since this one doesn’t, it can’t be debugged until we tell VS to give up on the CLR.

@krystian-mwebdev Wrong place to ask. Any links placed here will be immediately removed because there will be a non-trivial amount of people who will assume because it's on the official repo, it's a supported release.

I am happy to update README to reflect this.

On second thought, it looks like it is being addressed in #704.

I'm not sure this is actually in #704, @bkot88 feel free to make another pr

I've not added any new info in my PR, just fixed typo's ;)

It seems when debugging in "Native Only" mode, the app throws an exception when drop down is clicked (to open a new tab).

image

This is in src/cascadia/WindowsTerminal/main.cpp.

@bkot88 That's known, but the cause is very unknown at this time. Could you open a second issue to track that particular bug?

This problem _haunts_ us. The secret is something you'd never expect, and something that belongs in our getting started guide.

Go to the properties for the _CascadiaPackage_ project, choose Debug, and change the project type from "_Mixed (Managed and Native)_" to "_Native Only_".

The CascadiaPackage can crash Visual Studio when the Properties (right-click) menu is selected. To fix the crash so VS can load Properties, select x64 in the Platform dropdown.

cascadiapackage-properties-fix

Was this page helpful?
0 / 5 - 0 ratings