1

I created a .Net (C#) DLL to be used from a legacy application via COM. I can start the legacy app, instantiate the COM object, and use it -- no problem. I can start (or switch back to) Visual Studio, select Debug / Attach to Process, and choose the legacy app process. All the source files then get "lock" icons next to them, and the VS title bar changes to have "(Running)" next to the project name. I can set breakpoints, and exercising the COM object from the legacy app allows me to step through to debug. However, VS (of course) doesn't allow editing of the code to fix problems (or even correct spelling errors in comments). The Debug / Windows / Modules window shows the legacy process and my DLL and that symbols have been loaded for my DLL. Exiting from the legacy app (not surprisingly) removes the "lock" icons and the "(Running)" indicator in the title bar.

If I set the project for the COM object to start (in the Solution settings), set the Debug page of the project to "Start external program" and press F5 to start the legacy app, I can instantiate and exercise the COM object. The title bar again says "(Running)" and the lock icons appear. Hovering over a breakpoint shows a tooltip showing where we are --

filename.cs, line x character y ('namespace.class.method()') in process 'legacyapp.exe'

But breakpoints don't stop, and the Modules window is empty -- neither the legacy app nor my DLL show there. (So I guess it's not surprising the debugging doesn't work.)

I know that I've been able to do the "debug .Net-based COM DLL by starting external program" thing successfully in Visual Studio 2010. Does anyone have any idea what could possibly be causing this and, more important, any suggestions I can try to get it to work?

J.Merrill
  • 1,233
  • 14
  • 27

1 Answers1

1

I had the same problem with debugging in Visual Studio 2012 a COM-DLL via MSACCESS.

Solution: Create a config file for your office start program. Example: Create C:\Program Files (x86)\Microsoft Office\Office10\MSACCESS.EXE.config and insert

<?xml version="1.0"?>
<configuration>
   <startup>
      <supportedRuntime version="v2.0.50727"/>
   </startup>
</configuration>
Volker
  • 11
  • 1