Hi Suraj,
Support for VS 2010 and .Net 4 are separate issues.
ExcelDna currently supports only the .Net 2.0 runtime (which is the
most recent runtime before .Net 4 since .Net 3.0 and 3.5 were only
additional sets of libraries running on the same .Net 2.0 runtime). If
you can recompile your new library to target the .Net 2.0 runtime,
that should work immediately. I presume your .Net 4 library is not
loaded because the .Net runtime fails to load the library.
Support for .Net 4 in ExcelDna is very attractive and planned. But it
is not quite trivial if I'd like to keep the current support for .Net
2.0 and come up with a reasonable way to handle the initial loading
for all cases.
If you really have to get .Net 4 working urgently, you can contact me
directly to try a few things, but I'd rather you wait a bit.
As for VS 2010:
ExcelDna recompiles fine in VS 2010 after conversion and seems to work
exactly as before. (Please report any problems you run into after
compiling with VS 2010.)
However, I have run into the same problem you have, which is that
debugging seems problematic. If you set a breakpoint in your managed
code, and then run Excel.exe as the 'start external' program, your
code runs but the breakpoint is not hit.
I think this is a bug in the mixed debugging mode of VS 2010 - they
expect the mixed code to be native + .Net 4, and for ExcelDna at the
moment you need native + .Net 2.0.
This is not an ExcelDna isuue, but looks like a bug in VS 2010. The
Microsoft Connect case for the bug is here: Connect ID 554067 -
entitled "Cannot debug .NET 2.0/3.0/3.5 code using F5 in mixed mode
from native c++ projects or c# project with 'start external program'
set to native .exe"
https://connect.microsoft.com/VisualStudio/feedback/details/554067/cannot-debug-net-2-0-3-0-3-5-code-using-f5-in-mixed-mode-from-native-c-projects-or-c-project-with-start-external-program-set-to-native-exe
A workaround is to attach to a running instance of Excel.exe. You can
then pick the right debugging environment, and everything works fine.
What I've been doing is to call Debug.Fail(..) in my managed code, and
then run Excel from outside. When the Debug.Fail is hit, I can choose
to Debug with my VS session and everything is fine.
In terms of my priorities for ExcelDna:
- If there are any problems with Excel 2010 this will be my top
priority, but so far ExcelDna seems to work fine for me on Excel 2010.
- I'm trying to get some basic support in place for the Excel
2007/2010 Ribbon next.
- Then I'll have a look at .Net 4.
- Support for 64-bit support is very unlikely to come this year.
I'd welcome any feedback on what you'd like the priorities to be.
Regards,
Govert