project-system icon indicating copy to clipboard operation
project-system copied to clipboard

Unable to properly debug a netstandard project when starting a external executable

Open Pilchie opened this issue 7 years ago • 15 comments

From @Barsonax on May 29, 2018 14:23

Summary

Debugging doesnt seem to work properly when you start a net framework exe from a netstandard project through the Debug Launch setting. Everything else seems to be working fine.

When testing inside a game engine called duality I noticed this behavior. Latter on I found out that I can reproduce this in a separate project as well.

Some background info: In duality you add functionality through plugins which currently are portable projects. We want to eventually change this to netstandard projects. Plugins themselves are not runnable but instead we run duality itself when you try to run a plugin in VS. This will load all the plugins so you can proceed to debugging your plugin.

Note: the attached test project was simplified as much as possible to isolate the problem and thus does not include duality.

How to reproduce

  • Download and open the attached test project.
  • RebuildBuild the solution and start ClassLibrary1. This will actually start the exe generated by NetStandardDebugTest. Note that it will run properly.
  • Now set a breakpoint and run it again. Note that the break point will not work.
  • Now try to pause the execution. You will get a Unknown error 0x80004005

Attachments

Copied from original issue: dotnet/standard#760

Pilchie avatar Jul 08 '18 17:07 Pilchie

From @Barsonax on July 3, 2018 6:9

Its been a month and still nothing? Not expecting it to be fixed in that timeframe but some communication would be nice.

Pilchie avatar Jul 08 '18 17:07 Pilchie

From @weshaggard on July 6, 2018 22:1

@Barsonax this is more of a tooling issue then an issue with the standard. @Pilchie what is the correct repo to file this issue?

Pilchie avatar Jul 08 '18 17:07 Pilchie

:link: Also reported at https://developercommunity.visualstudio.com/content/problem/273462/support-debugging-net-standard-library-used-in-a-n.html

Pilchie avatar Jul 08 '18 17:07 Pilchie

Ideally we would be able to sniff the target exe and pick the debug engine automatically. Failing that, allowing specifying the engine in a launchSettings.json would help.

Pilchie avatar Jul 08 '18 17:07 Pilchie

Is there any workaround for this problem I can currently use while we wait on the real fix?

Rick-van-Dam avatar Sep 10 '18 09:09 Rick-van-Dam

Bump

Rick-van-Dam avatar Dec 10 '18 06:12 Rick-van-Dam

Just tested with VS2019 and its still not working. Is this ever getting fixed? Its been almost a year by now..

Rick-van-Dam avatar Jun 19 '19 12:06 Rick-van-Dam

Any news on this? This is currently a blocking issue that makes switching our project (linked in the referenced issue above) to .NET Standard less desirable, as the project very much relies on users to be able to debug plugin projects they're writing. Manually attaching post-startup isn't always an option, and a usability downgrade either way, especially since some of our users may use VS for the first time.

If we don't want to introduce regressions here, we're stuck with continuing to use PCLs - and that is slowly starting to fall apart due to them being deprecated.

Even a workaround would be greatly appreciated - if there is any config file, environment variable or similar we can automatically set when a user hits "Debug" in VS, that would be great to hear about.

ilexp avatar Jul 01 '19 14:07 ilexp

@Pilchie @jjmew any updates on this?

Rick-van-Dam avatar Jul 08 '19 20:07 Rick-van-Dam

I need this too!

ghost avatar Jul 09 '19 09:07 ghost

Any update on this issue? Even a workaround would be nice.

tripplet avatar Mar 06 '20 12:03 tripplet

We have worked around this by not depending on this anymore. We are now launching our application with a completely separate project that targets .NET. Not ideal but in our case it works.

https://github.com/AdamsLair/duality/issues/668

Still its strange that microsoft does not fix such a basic bug nor communicate about it.

Rick-van-Dam avatar Mar 06 '20 12:03 Rick-van-Dam

@Barsonax Thank you for the workaround, this didn’t occur to me. I just added a dummy project to the visual studio solution.

tripplet avatar Mar 06 '20 15:03 tripplet

still not working with VS2022!!

ThomasGuglerNagarro avatar Mar 25 '24 09:03 ThomasGuglerNagarro

Any News on this? Still not working on VS2022...

gunterwiesinger avatar May 21 '24 07:05 gunterwiesinger