E
excelthoughts
Hi,
Sorry about all the detail, but I am desperate. I cannot debug an Excel
Extensibility addin from C# in VS 2005. I have tried many attempts, as
detailed below to restore debugging ability to no avail. I am totally
frustrated and feel like I am the only person who has this problem, but I
know that is not true. So read on, if you're brave...
For the last 7 weeks my C# COM Interop (Excel Addin) Development has stopped.
I built an Excel Addin in C# in Visual Studio 2003, and was able to debug
the managed code successfully for a number of months. The breakpoints stopped
working a few times, but I was able to restore them by reinstalling the Addin
or correcting the Resiliency key added in the registry when Officed addins
are disabled in any Office product.
I then began to attempt to add functionality where my Excel Spreadsheet
could call the managed code. I had this working and could debug starting
from the VBA and then moving to the managed code.
During all the development time, I changed between Debug and Release modes
to test both configurations.
Then all debugging stopped working. In Visual Studio 2003, the breakpoints
said that they would not be hit and that no symbols were loaded. I ran Andy
Pennell's Breakpoint Helper, but it didn't apply. Standard Windows
Applications debug correctly, but COM Interop Addins do not.
I installed Visual Studio 2005 to attempt to fix the issue. The breakpoints
are now solid red, but are still ignored. There are no entries in the Modules
window when I run the Addin in Debug mode.
I created another Addin which is just a stub with 1 message box to run on
OnConnection. The MessageBox never shows. Excel always opens because it is
the App set in "Start External Program", but no managed code is run.
As per
http://spaces.msn.com/members/ilvyanyatka/Blog/cns!1pd2dVb-lPLLY1vqAckmYW8A!182.entry,
I added a config file specifying that the DLL should use v1.1 of the
framework in case this was the problem, and have added CLRVersionForDebugging
Key in the same vain. Neither solution did anything. Also tried creating an
Excel config file as per
http://msdn.microsoft.com/library/d...pgenref/html/gnconsupportedruntimeelement.asp
As per Andrew Whitechapel's advice, I tried sysinternals.com Process
Explorer app and watched the files loaded into Excel process. The file
mscorwks never appeared as it should, and no interop DLLs are loaded. I also
looked at http://support.microsoft.com/kb/908002/ and
http://support.microsoft.com/kb/908004/ (only for VSTO) to no avail.
So, I went down the reinstall windows option and here are the results.
a.Reinstall Windows
b.Install VS 2005
c.Install Office XP
d.Install Office XP PIAs
e.Create stub Extensibility addin with 1 message box.
f.Set Debug program to Excel 2002
g.In debug Configuration
h.build and Install the Addin.
i.Press f5 to run in the debugger.
Received Error Message:
Unable to start debugging. Check for one of the following.
1. The application you are trying to debug uses a version of the Microsoft
..NET Framework that is not supported by the debuuger.
2. The debugger has made an incorrect assumption about the Microsoft .NET
Framework version your appliaction is going to use.
3. The Microsoft .NET Framework version specified by you for debugging is
incorrect.
Please see the Visual Studio .NET debugger documentation for correctly
specifying the Microsoft .NET Framework version your application is going to
use for debugging.
Closes Excel.
I went into HKLM and found that there was no entry in
Software/Microsoft/Office/Addins/OriginalAddin.Connect, so I added them.
However, if I choose View > Registry from within my Addin, there are no
entries in HKLM.
There are entries for my stub Addin. However, the LoadBehavior keeps
reverting back to 2 for the stub addin even after I manually change it in the
Registry.
After changing the LoadBehavior to 3, when I opened Excel by itself, the
addins work. However, they still do not work from the debugger. Neither
mscorwks or any Interop DLLs are loaded in the Excel process.
I have looked at other user problem in the same realm but have not found
answers.
http://groups.google.com/group/micr...nSupportedRuntimeElement.asp#5be636cac099ffb2
http://groups.google.com/group/micr...n"+"c#"+office+loading&hl=en#12496db783c47fcd
Can anyone help before I throw my laptop in the bin?
Sorry about all the detail, but I am desperate. I cannot debug an Excel
Extensibility addin from C# in VS 2005. I have tried many attempts, as
detailed below to restore debugging ability to no avail. I am totally
frustrated and feel like I am the only person who has this problem, but I
know that is not true. So read on, if you're brave...
For the last 7 weeks my C# COM Interop (Excel Addin) Development has stopped.
I built an Excel Addin in C# in Visual Studio 2003, and was able to debug
the managed code successfully for a number of months. The breakpoints stopped
working a few times, but I was able to restore them by reinstalling the Addin
or correcting the Resiliency key added in the registry when Officed addins
are disabled in any Office product.
I then began to attempt to add functionality where my Excel Spreadsheet
could call the managed code. I had this working and could debug starting
from the VBA and then moving to the managed code.
During all the development time, I changed between Debug and Release modes
to test both configurations.
Then all debugging stopped working. In Visual Studio 2003, the breakpoints
said that they would not be hit and that no symbols were loaded. I ran Andy
Pennell's Breakpoint Helper, but it didn't apply. Standard Windows
Applications debug correctly, but COM Interop Addins do not.
I installed Visual Studio 2005 to attempt to fix the issue. The breakpoints
are now solid red, but are still ignored. There are no entries in the Modules
window when I run the Addin in Debug mode.
I created another Addin which is just a stub with 1 message box to run on
OnConnection. The MessageBox never shows. Excel always opens because it is
the App set in "Start External Program", but no managed code is run.
As per
http://spaces.msn.com/members/ilvyanyatka/Blog/cns!1pd2dVb-lPLLY1vqAckmYW8A!182.entry,
I added a config file specifying that the DLL should use v1.1 of the
framework in case this was the problem, and have added CLRVersionForDebugging
Key in the same vain. Neither solution did anything. Also tried creating an
Excel config file as per
http://msdn.microsoft.com/library/d...pgenref/html/gnconsupportedruntimeelement.asp
As per Andrew Whitechapel's advice, I tried sysinternals.com Process
Explorer app and watched the files loaded into Excel process. The file
mscorwks never appeared as it should, and no interop DLLs are loaded. I also
looked at http://support.microsoft.com/kb/908002/ and
http://support.microsoft.com/kb/908004/ (only for VSTO) to no avail.
So, I went down the reinstall windows option and here are the results.
a.Reinstall Windows
b.Install VS 2005
c.Install Office XP
d.Install Office XP PIAs
e.Create stub Extensibility addin with 1 message box.
f.Set Debug program to Excel 2002
g.In debug Configuration
h.build and Install the Addin.
i.Press f5 to run in the debugger.
Received Error Message:
Unable to start debugging. Check for one of the following.
1. The application you are trying to debug uses a version of the Microsoft
..NET Framework that is not supported by the debuuger.
2. The debugger has made an incorrect assumption about the Microsoft .NET
Framework version your appliaction is going to use.
3. The Microsoft .NET Framework version specified by you for debugging is
incorrect.
Please see the Visual Studio .NET debugger documentation for correctly
specifying the Microsoft .NET Framework version your application is going to
use for debugging.
Closes Excel.
I went into HKLM and found that there was no entry in
Software/Microsoft/Office/Addins/OriginalAddin.Connect, so I added them.
However, if I choose View > Registry from within my Addin, there are no
entries in HKLM.
There are entries for my stub Addin. However, the LoadBehavior keeps
reverting back to 2 for the stub addin even after I manually change it in the
Registry.
After changing the LoadBehavior to 3, when I opened Excel by itself, the
addins work. However, they still do not work from the debugger. Neither
mscorwks or any Interop DLLs are loaded in the Excel process.
I have looked at other user problem in the same realm but have not found
answers.
http://groups.google.com/group/micr...nSupportedRuntimeElement.asp#5be636cac099ffb2
http://groups.google.com/group/micr...n"+"c#"+office+loading&hl=en#12496db783c47fcd
Can anyone help before I throw my laptop in the bin?