c# - Attach Visual Studio debugger to VS IDE Host -
i trying test application using visual studio 2015 shell (isolated).
for testing extension package visual studio, found samples older versions. this:
[testmethod] [hosttype("vs ide")] public void createvisualization() { testutils testutils = new testutils(); testutils.closecurrentsolution(__vsslnsaveoptions.slnsaveopt_nosave); testutils.createprojectfromtemplate(testcontext.testdir, "myprojecttype", "myprojecttype.zip"); testutils.closecurrentsolution(__vsslnsaveoptions.slnsaveopt_nosave); }
my problem can not debug tests, because debugger not attach vs ide
host process. once, remove hosttype-annotation, can set breakpoints , debug it, test not run inside correct process. verified attaching not work, writing endless-loop inside test , manually attaching started process (which enable debugging).
is there way automatically attach visual studio debugger started process upon starting test, can debug without manual "attach process"-step?
edit:
i've tried several solutions, nothing worked far:
- how host vs ide during integration test via mstest? started visual studio not application
- visual studio: auto attach process when process spawned had mixed results.
debugger.launch
works, still requires tedious "select debugger ..." dialog accepted - microsoft's own suggested way automatically attach debugger not work, launches jit-debugger when starting application, not when running (and debugging) tests.
if want set debugger auto attach on process start, can use registry editor, not convenient:
https://msdn.microsoft.com/en-us/library/a329t4ed(v=vs.100).aspx
a simple way use tool wrote eyal rosner here:
http://www.codeproject.com/articles/1090417/how-to-set-debugger-to-auto-attach-on-process-star
it easy set registry editor.
Comments
Post a Comment