terminal icon indicating copy to clipboard operation
terminal copied to clipboard

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

Open finesse-fingers opened this issue 7 years ago • 11 comments

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)

finesse-fingers avatar May 11 '19 07:05 finesse-fingers

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".

DHowett-MSFT avatar May 11 '19 20:05 DHowett-MSFT

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

pkarakal avatar May 11 '19 21:05 pkarakal

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.

DHowett-MSFT avatar May 11 '19 21:05 DHowett-MSFT

@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.

oising avatar May 11 '19 22:05 oising

I am happy to update README to reflect this.

finesse-fingers avatar May 11 '19 22:05 finesse-fingers

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

finesse-fingers avatar May 11 '19 22:05 finesse-fingers

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

zadjii-msft avatar May 12 '19 15:05 zadjii-msft

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

TheCloudSaver avatar May 12 '19 16:05 TheCloudSaver

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.

finesse-fingers avatar May 13 '19 01:05 finesse-fingers

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

zadjii-msft avatar May 13 '19 14:05 zadjii-msft

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

curtisgray avatar Apr 09 '20 04:04 curtisgray