Skip to content
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

Make the Debug build debuggable #9744

Merged
merged 2 commits into from Nov 20, 2021

Conversation

RussKie
Copy link
Member

@RussKie RussKie commented Nov 20, 2021

An addendum to #9704.

Proposed changes

  • The .NET bootstrap created a .NET Framework entry point. This tricks the debugger, and it doesn't see the app as a .NET process, and, thus, unable to hit any breakpoints.
    To mitigate this, only apply the bootstrap to the Release configuration.
  • Correct path to our executable under DotnetRuntimeBootstrapper.
    Resolves [NBug] Could not find a part of the path 'C:\Program Files\dotnet\... #9743

An addendum to gitextensions#9704.

The .NET bootstrap created a .NET Framework entry
point. This tricks the debugger, and it doesn't see the app as a .NET
process, and, thus, unable to hit any breakpoints.

To mitigate this, only apply the bootstrap to the Release configuration.
@ghost ghost assigned RussKie Nov 20, 2021
@RussKie RussKie changed the title Restore debuggable Make the Debug build debuggable Nov 20, 2021
@RussKie RussKie merged commit 7073f86 into gitextensions:master Nov 20, 2021
@RussKie RussKie deleted the restore_debuggable branch November 20, 2021 08:09
@ghost ghost added this to the vNext milestone Nov 20, 2021
@gerhardol
Copy link
Member

Can this be changed to allow tests in Debug too?
(comment in #9745 that fixed another test issue in Debug)

@RussKie
Copy link
Member Author

RussKie commented Nov 20, 2021 via email

@gerhardol
Copy link
Member

Disabling privately for now, there must be a better way.
I had expected that #if !TEST would work but the application libs are not built with that define.
Some mocking could be used, but all affected tests will have to be updated.

@gerhardol
Copy link
Member

gerhardol commented Nov 20, 2021

There are also random "Unhandled exception" popups that hang tests (occurred before this change).
In that change there should not be a popup but fail immediately.

The reason for the illegal directory is unknown.

image

RussKie added a commit to RussKie/gitextensions that referenced this pull request Nov 21, 2021
@RussKie RussKie mentioned this pull request Nov 21, 2021

// Under DotnetRuntimeBootstrapper this points to C:\Program Files\dotnet\dotnet.exe
// whereas we need our executable
private static string _applicationExecutablePath = Assembly.GetEntryAssembly().Location.Replace(".dll", ".exe");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: it's safer to use Path.ChangeExtension(...) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NBug] Could not find a part of the path 'C:\Program Files\dotnet\...
3 participants