Debugging Razor Class library VS 2017
Eilon opened this issue · 4 comments
From @olegsavelos on Wednesday, 03 October 2018 11:49:34
I am trying to debug a razor class library hosted by external process.
I have set the configuration to a Launch: Executable this indeed start the executable but it don't seem that Visual Studio attaches to the process as i don't see no modules to be loaded and cant break.
In contradiction with a normal .NET class library when using the same approach Visual Studio attaches correctly to the launched process and debugging/breaking is possible.
Here is example of launchSettings.json
"profiles": {
"SampleModule": {
"commandName": "Executable",
"executablePath": "C:\Programs\executable.exe",
"workingDirectory": "C:\Programs\"
},
Copied from original issue: dotnet/aspnetcore#3579
Thanks for contacting us, @olegsavelos.
@pranavkm, can you please look into this? Thanks!
@olegsavelos could you share a sample app that reproduces the error? I'm not entirely sure what you mean hosted by external process means here.
Actually i just tried wit a simple .NET Core library and the effect is the same.
Basically to replicate create an .net core dll and set it to launch executable in debug settings.
When you start debugging you will see the process launched and it looks like the debugger is attached to the launched process but its not, you can see that no dll modules are loaded nor there is any output debug output console of Visual Studio.
If you detach from the process and reattach manually you will get everything working normally.
With normal class libraries the debug launch/attach process works correctly you immediately have the Visual Studio attached and able to debug or edit code.
@olegsavelos still not sure I follow. What's the entry point in your application - since a class library isn't executable? I tried this on a .NET Core console app (setting the exe to dotnet
and pointing to the build output) and things worked fine. That said, seeing that the issue isn't specific to Razor Class Libraries and .NET Core Class Libraries, using VS feedback would be the more appropriate channel to report this. I'm going to close this, since there doesn't seem to be a RCL specific issue to diagnose here.