-
Notifications
You must be signed in to change notification settings - Fork 420
Debugging Omnisharp Roslyn with Visual Studio
From Dustin Campbell on slack.
(I'll clean this up later and convert it to a proper write up. Just want to save the relevant bits in here first).
danwalmsley [10:08]
do you guys know how I can tell visual studio to launch a process and immediately attach debugger?danwalmsley [10:08]
rather than me attaching when its already run past the code I need to debug?dustinc [10:09]
There are a lot of problems with that with the new MSBuild stuff on Windowsdustinc [10:09]
here's the thingdustinc [10:09]
MSBuild likes to be in the same directory as your application.dustinc [10:09]
However, when debugging old xproj stuff, it redirects to the MSBuild that is installed in your Nuget folderdustinc [10:09]
and stuff breaksdustinc [10:10]
That's what happens on F5 for MSBuild anywaydustinc [10:10]
So, I tend to do the following.dustinc [10:11]
- Run OmniSharp at the command-line with the arguments I need (e.g.
--stdio -s <my project or solution file>
). I also include the--debug
argument.dustinc [10:11]
2. Then, I attach Visual Studio to the running OmniSharp.exe.Note: I run OmniSharp from my artifacts/public/OmniSharp/default/net46 directory
dustinc [10:12]
on Windowsdustinc [10:12]
Reverse the slashes.
danwalmsley [10:12 AM]
What does--debug
do?
dustinc [10:13]
It stops OmniSharp from loading until a debugger is attached