Unmanaged Debugging vs. Managed Debugging vs. Mixed Debugging.
All versions of VS support debugging both managed and unmanaged code. However there is a big difference between doing one or the other and doing both. GreggM has written about some of the reasons interop debugging is difficult. Here I will refer to debugging both managed and unmanaged at the same time as Mixed debugging.
If you are having stability problems when debugging, one reason may be you are doing Mixed debugging without realizing it. If you have a C# or VB project that uses unmanaged COM objects, at some point you may have wanted to debug into the COM object. Somewhere along the line someone right clicked on the project in the Solution Explorer, went to properties, then “Configuration Properties/Debugging/Enable Unmanaged Code”, and set it to true. If you did this, you enabled Mixed debugging. There are some cool features you get with that, and some features you lose. On balance Mixed debugging is almost never worth it. Mixed is more intrusive, and less stable then either approach alone. If you are debugging a Managed Application you should not turn on ‘unmanaged debugging’ unless you have a specific need for it. One great feature of using managed or native debugging alone is you can attach and detach at will. One of the features you lose with Mixed is the ability to detach.
If you attach to a process it will default to debugging all program types in the process. Don’t accept this default! If you attach in Mixed mode “Common Language Runtime” and “Native” are both checked. Pick one, if you don’t like what you picked, detach and reattach with the other. Your life will be much easier.
C# and VB projects do not have a way to turn off managed debugging. If you want to native debug a application that starts from a managed exe, my suggestion is to leave the original project as managed only, and create an additional project to do your native debugging. The most versatile way is to create an empty VC++ makefile project. Right click on the solution, Add/ New Project/ Visual C++/Makefile Project. Right click on the new project Properties/Debugging/Debugger Type. There are 4 choices: “Native only”, ”Managed Only”, “Mixed”, and “Auto”. Use Native only. Never use Auto. A few rows up is “Command”, left click to get a dropdown with Internet Explorer, ActiveX container, regsvr32 and browse. Pick browse and find the .exe output of your current startup project. Finally in the top right of this property dialog is a button “Configuration Manager”. Click on it and you will see a list of the projects in the Solution with configuration, platform, and check box on whether it should build. Uncheck the build box for the makefile project you just created. At this point you can set the makefile project to be the startup project: Right click on the Project /Set as Startup Project. You will now launch in native debugging mode. You can either switch statup projects or switch the Debugger Type setting in the makefile project to switch back and forth. You can also detach when debugging this way and reattach with the other debugger type. This is typically more flexible, stable, and productive.
Comments
Anonymous
May 12, 2004
An easier way is to right-click on solution node, choose add project and then navigate to your exe and add it. .EXE is a recognized C++ project type. You still have to follow the steps mentioned above. Of course, you do need C++ installed as part of your VS setup.Anonymous
August 03, 2005
Steve Steiner of the MS debugger team tells
why.Anonymous
February 07, 2006
Hi. I have a mixed project (C++ Managed library) that uses managed and unmanaged code. I am having problems in debugging native (unmanaged) code. The breakpoints don’t work (when I put one in the native code, appears a “?” ) and I can not give a “step into” for native codes. It is intriguing that some native codes debug works well, but for most of it, it doesn’t.
This C++ library do not use others libraries, just native codes. It is used for a C# .Net application.
I have changed the "debuger type" option from Mixed to Native Only, but this did not help. I have checked the Assembly files path already.
What can be wrong that makes me unable to debug native C++ code?Anonymous
February 24, 2006
I have the exact same problem as Eliseu. Has anyone figured out a solution?Anonymous
March 01, 2006
Eliseu - I am also experiencing this problem...and I still haven't found a solution...Anonymous
August 15, 2006
Steve Steiner of the MS debugger team tells why .Anonymous
August 26, 2006
Very many thanks for a good work. Nice and useful. Like it!Anonymous
October 02, 2006
The comment has been removedAnonymous
October 02, 2006
<a href="http://cat.karelia.ru/new/map.html">map</a>">http://cat.karelia.ru/new/map.html">map</a> <a href="http://cat.karelia.ru/new/index.html">index</a>">http://cat.karelia.ru/new/index.html">index</a> [URL=http://cat.karelia.ru/new/map.html]replica-watch[/URL] [URL=http://cat.karelia.ru/new/index.html]replica-watch[/URL]Anonymous
October 03, 2006
The comment has been removedAnonymous
October 05, 2006
Uau! <a href="http://hometown.aol.com/home0depot/home-depot-home.html">Home">http://hometown.aol.com/home0depot/home-depot-home.html">Home depot for you</a> [url=http://hometown.aol.com/home0depot/home-depot-home.html]Home depot for you[/url] cool!Anonymous
October 12, 2006
You have great site, impressive! Look at mine <a href="http://hometown.aol.com/celebrityseek/paris-hilton.html ">Paris Hilton</a> or [url=http://hometown.aol.com/celebrityseek/paris-hilton.html]Paris Hilton[/url] bye!Anonymous
October 12, 2006
You have great site, impressive! Look at mine <a href="http://hometown.aol.com/celebrityseek/paris-hilton.html ">Paris Hilton</a> or [url=http://hometown.aol.com/celebrityseek/paris-hilton.html]Paris Hilton[/url] bye!Anonymous
October 13, 2006
...is verry good idea! Good site, all you need is LOVE !!! (Beatls)Anonymous
October 14, 2006
http://megspace.com/family/monedu/rnew/replica-watch-source.htmlAnonymous
October 14, 2006
[URL=http://megspace.com/lifestyles/uldiaz1/diazepam-5mg.html]diazepam-5mg[/URL]Anonymous
October 15, 2006
http://megspace.com/lifestyles/uldiaz1/map.htmlAnonymous
October 18, 2006
Great site!! My pages <a href="http://hometown.aol.com/eqpills/ephedra.html ">Ephedra</a> or [url=http://hometown.aol.com/eqpills/ephedra.html]Ephedra[/url] bye!Anonymous
October 19, 2006
[URL=http://megspace.com/lifestyles/uldiaz1/diazepam-dog.html]diazepam-dog[/URL]Anonymous
October 27, 2006
The comment has been removedAnonymous
November 07, 2006
Thank you for your site. I have found here much useful information!Very cool design!Added to favorites!! My site: http://titan-tankless-waterheater.blogspot.comAnonymous
November 08, 2006
Good site... visit my site about LEXUS! http://lexus.vipautocatalog.infoAnonymous
November 13, 2006
The Site is excellent! Great job! Visit My blog about A sport utility vehicle, or SUV. http://myblog.es/suvcatalog [url=http://myblog.es/suvcatalog]suv catalog: used suv[/url]Anonymous
November 15, 2006
Good site! Great design... and respect webmaster! visit my blog about my car http://myblog.es/cadillacsuv I like Cadillak! [URL=http://myblog.es/cadillacsuv]cadillacsuv[/URL]Anonymous
November 18, 2006
Wonderful and informative web site.I used information from that site its great. My Catalogue site of Biker jacket leather http://solisearch.net/bloghoster/?u=siniyAnonymous
November 19, 2006
PLASTIC SURGERY WEIGHT. CLICK HERE! ALL ABOUT PLASTIC SURGERY WEIGHT! <a href="http://www.onlinewebservice6.de/gastbuch.php?id=124796">plastic">http://www.onlinewebservice6.de/gastbuch.php?id=124796">plastic surgery weight</a> http://www.onlinewebservice6.de/gastbuch.php?id=124796Anonymous
November 19, 2006
Good site! well...)) good design..! [URL=http://www.onlinewebservice6.de/gastbuch.php?id=124796 ]plastic surgery weight[/URL] http://www.onlinewebservice6.de/gastbuch.php?id=124796Anonymous
November 23, 2006
The comment has been removedAnonymous
November 23, 2006
Hi! check this <a href=http://akoc-icco.ru/wonder-woman-costume>wonder woman costume</a>Anonymous
November 24, 2006
peace! <a href=http://akoc-icco.ru/wholesale-watch>wholesale watch</a>Anonymous
November 24, 2006
I love you! <a href=http://akoc-icco.ru/wholesale-toy>wholesale toy</a>Anonymous
November 25, 2006
<a href=http://akoc-icco.ru/wholesale-tool>wholesale tool</a>Anonymous
November 25, 2006
<a href=http://akoc-icco.ru/wholesale-tire>wholesale tire</a>Anonymous
November 26, 2006
<a href=http://akoc-icco.ru/wholesale-sports>wholesale sports</a>Anonymous
November 26, 2006
<a href=http://akoc-icco.ru/wholesale-silver-jewelry>wholesale silk flower</a>Anonymous
November 26, 2006
<a href=http://akoc-icco.ru/wholesale-silk-flower>wholesale silk flower</a>Anonymous
November 26, 2006
<a href=http://akoc-icco.ru/wholesale-ribbon>wholesale ribbon</a>Anonymous
November 27, 2006
<a href=http://akoc-icco.ru/wholesale-picture-frame>wholesale picture frame</a>Anonymous
November 29, 2006
Today was a complete loss. I feel like a fog. I've just been hanging out doing nothing, but eh...Anonymous
November 29, 2006
Your site looks great! Would you please also visit my homepage? <a href= ></a> [url=][/url]Anonymous
November 30, 2006
I've just been letting everything pass me by lately. I've more or less been doing nothing. Not much going on lately. I can't be bothered with anything recently.Anonymous
November 30, 2006
<a href= http://forum.lixium.fr/cgi-bin/index.eur?mitsu > wellbutrin medication </a> [url= http://forum.lixium.fr/cgi-bin/index.eur?mitsu ] wellbutrin medication [/url]Anonymous
December 04, 2006
Good site! Well.. i like design!Anonymous
December 08, 2006
Very good project! <a href= www.debtconsolidation.newov.info >debt consolidation</a> <a href= www.badcreditloan.newov.info >bad credit loan</a>Anonymous
December 08, 2006
Very nice resources!<a href= www.mortgagerefinancing.newov.info >mortgage refinancing</a> <a href= www.autoinsurancequote.newoz.info >auto insurance quote</a>Anonymous
December 10, 2006
Well...good news, i like your site, Happy new year! )))Anonymous
December 11, 2006
Well, your site is very good, good news and design...! ))) Happy Christmas! SmilerMan.Anonymous
December 14, 2006
Very nice resources!<a href= http://betting.ggfix.com >betting</a> <a href= http://wagering.ggfix.com >wagering</a>Anonymous
December 17, 2006
Happy New Year! real good site!Anonymous
December 18, 2006
real good news! good site, respect webmaster!Anonymous
December 18, 2006
Hi there! Your site is cool, indeed! Visit my sites, please: <a href= ></a> [url=][/url]Anonymous
December 27, 2006
http://allergies-pedia.googlegroups.com/web/allergy%20asthma%20induced.html?gda=rIwMQlEAAAALW6FvpEbToAJuf0u5jX5YFRzacMt3mssOVk0t9bMaCRVJVT3hrgKrn_IySc8la3I82CZxIrPCghV5P_RnjFgqR-N6lcbUGhxyEiqiLs_zEi08VVU3fRS65b6689NGZ3Q <a href="http://allergies-pedia.googlegroups.com/web/allergy%20asthma%20induced.html?gda=rIwMQlEAAAALW6FvpEbToAJuf0u5jX5YFRzacMt3mssOVk0t9bMaCRVJVT3hrgKrn_IySc8la3I82CZxIrPCghV5P_RnjFgqR-N6lcbUGhxyEiqiLs_zEi08VVU3fRS65b6689NGZ3Q">allergy asthma induced</a>Anonymous
January 18, 2007
Perfect site, i like it! <a href= http://docs.google.com/View?docid=df2wwh2p_7c7mc89 >Debt Consolidation</a> [url=http://docs.google.com/View?docid=df2wwh2p_7c7mc89]Debt Consolidation[/url] goodbyeAnonymous
January 19, 2007
Hi there! Your site is cool, indeed! Would you please also visit my homepage? <a href= http://fm7.biz/0l6t >ephedra</a> [url=http://fm7.biz/0l6t]ephedra[/url]Anonymous
January 25, 2007
Thank you! http://symy.jp/?Ct_220745,Thank">http://symy.jp/?Ct_220745,Thank you! http://symy.jp/?Ct_220745Anonymous
January 26, 2007
Great work! [url=http://qiqkjipe.com/ckow/knrb.html]My homepage[/url] | [url=http://hjdnssvk.com/ihnk/ynme.html]Cool site[/url]Anonymous
January 28, 2007
Over the last month I have been busy doing [url=http://www.linkwizard.net]link exchange[/url] and getting links back to my site. Mainly reciprocal, directories, search engines and a few one-way back links. I ran the link report in Web CEO for my index page which gave the following results: MSN 234 - Yahoo 11 - Google 0. Now, this is telling me something. Is it that MSN are not so fussy as the other two in recognising any form of link back as an authority for the website. Thereby making it easier to obtain top ranking positions for chosen keyword phrases that are the anchor text in the link. If so, to be successful with Yahoo and Google do you have to concentrate on getting top quality, relevant one-way back links. Like making sure the site that has a link to you uses your keywords in their title and anchor text etc. And that sites that link to that site also have keyword relevant content/links etc. This isn't taking into account on-page optimization. I await your comments with interest.Anonymous
January 30, 2007
Nice site! http://32url.com/?iSlf,Nice">http://32url.com/?iSlf,Nice site! http://32url.com/?iSlfAnonymous
February 05, 2007
This is my site: http://shurl.net/2SU ,This is my site: http://shurl.net/2SUAnonymous
February 10, 2007
Re:http://www.onlinewebservice6.de/gastbuch.php?id=128990 <a href="http://www.onlinewebservice6.de/gastbuch.php?id=128990">Replica bag, handbag</a>Anonymous
February 13, 2007
The excellent site!!! Want you good luck!!!,The excellent site!!! Want you good luck!!!,The excellent site!!! Want you good luck!!!,The excellent site!!! Want you good luck!!!Anonymous
February 18, 2007
More information, you work, stress, then you focus on a creative. Appraisal discussion, ask figure of his new overcome, or off to describe. Foundation for them out the basic level, this regularly undertake a [url=http://learnin.43i.net ]learning center.[/url].Anonymous
February 19, 2007
Best my wishes to Admin. Plz look my site too: <a href=http://linkin-park.creablog.com>linkin">http://linkin-park.creablog.com>linkin park concert ticket</a> | [url=http://linkin-park.creablog.com]linkin park concert ticket[/url] | http://linkin-park.creablog.com - linkin park concert ticket ! Thanks. p.s. Linkin Park Concert TicketAnonymous
February 21, 2007
The excellent site!!! Want you good luck!!!,The excellent site!!! Want you good luck!!!,The excellent site!!! Want you good luck!!!,The excellent site!!! Want you good luck!!!Anonymous
February 24, 2007
This is a wonderful page for everyone! Please visit my homepage: [@../doorway/blogspot/tr3.txt||10||p-11||3||, This is a wonderful page for everyone! Please visit my homepage: [@../doorway/blogspot/tr3.txt||10||p-11||3||Anonymous
February 24, 2007
The excellent site!!! Want you good luck!!!,The excellent site!!! Want you good luck!!!,The excellent site!!! Want you good luck!!!,The excellent site!!! Want you good luck!!!Anonymous
February 26, 2007
Very well! Your site is neat! Please visit my site too: [@../doorway/blogspot/tr10.txt||7||p-1||1||,Very well! Your site is neat! Please visit my site too: [@../doorway/blogspot/tr10.txt||7||p-1||1||Anonymous
March 05, 2007
I have already enjoy your website, and it is so nice and cool. I will visit your website again. Thank you. Please More updatesAnonymous
March 08, 2007
Looks great! I found lots of intresting things here. I will visit your website again. http://jeezy.blogcu.com/ Young JeezyAnonymous
March 08, 2007
Looks great! I found lots of intresting things here. I will visit your website again. http://jeezy.blogcu.com/ Young JeezyAnonymous
March 08, 2007
Looks great! I found lots of intresting things here. I will visit your website again. http://jeezy.blogcu.com/ Young JeezyAnonymous
March 08, 2007
I have already enjoy your website, and it is so nice and cool. I will visit your website again. <a href= http://xenicalonline.blogcu.com >Xenical</a> [url= http://xenicalonline.blogcu.com ]Xenixal[/url]Anonymous
March 10, 2007
Looks great! I found lots of intresting things here. Many thanks. Nice site. Cheers!Anonymous
March 12, 2007
I just want to say thank you for taking the time & effort for put this web page together! Please visit my homepage: , I just want to say thank you for taking the time & effort for put this web page together! Please visit my homepage:Anonymous
March 14, 2007
Looks great! I found lots of intresting things here. Many thanks. Nice site. Cheers!Anonymous
March 17, 2007
The comment has been removedAnonymous
March 19, 2007
Nice site! Cheak my site to! It is fresh idea i think ;) <a href= http://plavix.stormloader.com >plavix</a>Anonymous
March 22, 2007
Hi Sam! You letter i received. Thanks! Photos is nice!!! ,Hi Sam! You letter i received. Thanks! Photos is nice!!!Anonymous
March 22, 2007
Lucy! Please call me,Lucy! Please call meAnonymous
March 23, 2007
Lucy! Please call me,Lucy! Please call meAnonymous
March 27, 2007
<a href="http://mywebpage.netscape.com/adware1removal/adware-se.htm">adware</a>">http://mywebpage.netscape.com/adware1removal/adware-se.htm">adware</a> 1 FREE ADWARE 2 [url=http://mywebpage.netscape.com/adware1removal/adware-se.htm]adware[/url]Anonymous
March 31, 2007
Very nice! I have some LJ with news, check this out: <a href= http://iwantubadlyz.livejournal.com >Newest news</a> <a href= http://annakubat.livejournal.com >Check this out</a> <a href= http://jackie_simpson.livejournal.com >livejournal</a>Anonymous
April 04, 2007
Very nice! I have some sites with news, check this out: <a href= http://nuhost.info >Politics news</a> <a href= http://susearch.info >Lastest news</a> <a href= yanasearch.info >Lifestyle news</a>Anonymous
April 07, 2007
visit us, i could found very usefull informationAnonymous
April 10, 2007
domai archive domai diana domai elleAnonymous
April 17, 2007
This is really fresh idea of the design of the site! I seldom met such in Internet. I will visit your website again. Good Work dude!Anonymous
April 18, 2007
This is really fresh idea of the design of the site! I seldom met such in Internet. I will visit your website again. Good Work dude!Anonymous
April 18, 2007
The Best Catalog. <a href=http://healthpiece.info/>Real">http://healthpiece.info/>Real Catalog</a>[url=http://healthpiece.info/]The Real Catalog[/url]Anonymous
April 19, 2007
<a href= http://www.angelfire.com/indie/cucone >a ture story</a> <a href= http://www.angelfire.com/hiphop/hugole >a2 size inches</a> <a href= http://www.angelfire.com/goth/qoxuxa >a thousand miles piano music sheet</a> <a href= http://www.angelfire.com/funky/pimeho >a e slide topper</a> <a href= http://www.angelfire.com/punk/dimyxi >a jaffe wedding rings</a>Anonymous
April 22, 2007
My compliments to a very nice website. I found lots of intresting things here. Many thanks. Good Work dude!Anonymous
April 24, 2007
Hi Sam! Photos i send on e-mail. Green,Hi Sam! Photos i send on e-mail. GreenAnonymous
April 24, 2007
Hi Sam! Photos i send on e-mail. Green,Hi Sam! Photos i send on e-mail. GreenAnonymous
April 25, 2007
http://omfree.com/nba-basketball-videosAnonymous
April 27, 2007
My compliments to a very nice website. I found lots of intresting things here. p.s. More How To Have you don't take it acknowledges that shirt looks like more intimate than men.Anonymous
April 30, 2007
<a href= http://dietary-supplements.piercing-shop.biz >dietary</a>Anonymous
April 30, 2007
<a href= http://dietary-supplements.piercing-shop.biz >dietary</a>Anonymous
May 03, 2007
"It's not because of fate, it's because of Tequila" That may be the best thing I have ever read in my whole life!Anonymous
May 06, 2007
Looks great! I found lots of intresting things here. Please more updates.Anonymous
May 06, 2007
Ja Krevetko! http://buncootcprilosec.iwannaforum.com/ <a href='http://buncootcprilosec.iwannaforum.com/'> bunco otc prilosec </a>Anonymous
May 07, 2007
Ja Krevetko! http://buncootcprilosec.iwannaforum.com/ <a href='http://buncootcprilosec.iwannaforum.com/'> bunco otc prilosec </a>Anonymous
May 08, 2007
The comment has been removedAnonymous
May 12, 2007
Very good website you have here, After the visit I put my step in to your guestbook.Anonymous
May 13, 2007
Good site! It very impressive, easy to find helpful information. Keep up the great work.Anonymous
May 15, 2007
Looks great! I found lots of intresting things here. Please more updates. http://valium1.blogcu.com/ Buy ValiumAnonymous
May 15, 2007
"It's not because of fate, it's because of Tequila" That may be the best thing I have ever read in my whole life! http://valium1.blogcu.com/ Buy ValiumAnonymous
May 20, 2007
Good Work dude! I will visit your website again.Anonymous
May 24, 2007
<a href="http://extremedrawing.tripod.com/">adult comics</a>Anonymous
May 27, 2007
This is really fresh idea of the design of the site! I seldom met such in Internet. Good Work dude!Anonymous
May 28, 2007
Site - very comprehensive and meticulous from all sides, its good! Just excellent website, I sure!Anonymous
May 28, 2007
Good site! It very impressive, easy to find helpful information. Keep up the great work.Anonymous
June 01, 2007
dyeq5m86nm2518nq <a href = http://www.516888.com/1042058.html > vezacgbk </a> [URL=http://www.570414.com/272754.html] bmfcmg9e9fd0ldde [/URL] 13e2weaihAnonymous
June 04, 2007
"It's not because of fate, it's because of Tequila" That may be the best thing I have ever read in my whole life!Anonymous
June 09, 2007
Great site and excellent resource you have. I think it's very cool. I will visit your website again. Thank you!Anonymous
October 01, 2007
Hi, nice page.! look on my pages: <a href="http://profitb.free-site-host.com/associate-international-profit/associate-international-profit-sbrb.html">associate international profit sbrb</a> ok.. bitteAnonymous
December 12, 2007
The comment has been removedAnonymous
January 06, 2008
The comment has been removedAnonymous
January 19, 2008
On <a href=http://groups.google.at/group/erykah9803/web/klingeltne-selber>klingelt�ne selber</a> muck keno seconds call tilt <a href=http://groups.google.at/group/erykah9803/web/klingeltne-zum-downloaden>klingelt�ne zum downloaden</a> push hand pasadena hole <a href=http://groups.google.at/group/xaviera7608/web/klingeltne-zum-anhren>klingelt�ne zum anh�ren</a> variance line front city card vigorish?Anonymous
January 24, 2008
Are ez money payday loan 100 loan online payday