Shimmed COM Add-in gets copied to LocalSettings folder???



I have a managed COM add-in for Word/Excel/PowerPoint to which I've recently
added a shim with the help of this NG (thanks Mike).

I can deploy this to a target machine and everything works fine. However,
I'm still having real problems getting it to work on my development machine.

As I mentioned in another post, my managed DLL tries to load configuration
settings from a config file located alongside the DLL. I get the location of
the DLL itself using GetExecutingAssembly().Location.

Having deployed my add-in on another machine, this maps on to
ProgramFiles/MyCompany/MyApp/MyDll.dll as I'd expect.

However, on my development machine, it maps onto somewhere bizarre in the
LocalSettings folder:
C:\DocumentsAndSettings\MyLogin\LocalSettings\ApplicationData\Assembly\dl2\
(some random letters)\MyDll.dll

At first I thought that this was simply a problem with what the CodeBase
property is returning, but I've since discovered that there is actually a
copy of my managed DLL at that location! When I did a File Find for
MyDll.dll I found dozens of them, all somewhere in the dl2 directory but
with a different set of random letters. I'm guessing that a new one gets
created every time I build (or run?) the DLL.

What's even worse is that I've now discovered that if I make a chance to the
source for my DLL and then build & run it by starting Word, the version of
the DLL that actually gets executed is not the one that I just built! (I
figured this out after I put in some extra tracing code that didn't get
executed - took me a long while to understand that this is what the problem
was).

Can anyone help me here? I've seen some chatter on the web about the
LocalSettings directory being used for DLLs that are downloaded, but that
doesn't seem to apply in this case. What's going on?

Thanks in advance,
Gary


.



Relevant Pages

  • Re: regsvr32 error code 0x80004002
    ... I also have seen this error when there is a missing dll that your dll depends on. ... this invocation of regsvr32 succeeds. ... On another PC which also has VS2005 SP1 installed, an installer which was created by a VS2005 SP1 setup project did indeed insist on installing an extra copy of the redistributables. ... Sorry Norman, the context that this was happening on your development machine was lost, so I had forgotten that VS was installed. ...
    (microsoft.public.vc.mfc)
  • Re: registering dlls
    ... Check the code of the init event of that class and see whether any of the ... > dll has registered successfully. ... > Instances of the class can be created fine on my development machine. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: "Error in loading DLL", VB6 ActiveX DLL
    ... By "the code will execute in debug mode without errors", ... you set a reference to the DLL? ... However, on the development machine, the code will execute in debug ...
    (microsoft.public.excel.programming)
  • Will a P&D packaged DLL (DLLSelfRegister) be registered correctly on all OSs?
    ... The program works great on the development machine and on test machines after the dll is manually registered using regsvr32. ... I used the P&D Wizard to create a setup package, and I'm wondering if the DLL will be automatically registered on ever OS from 98 up when the installation is done using the setup files? ... Or is it good practice to register it from VB before the program needs to use the dll, e.g. from Sub Mainat program startup? ...
    (microsoft.public.vb.general.discussion)
  • Re: Accessing office addins...
    ... I tried to do a shared dll with static variables.. ... get value from add-in (set variables is from windows app) values are null.. ...
    (microsoft.public.dotnet.languages.csharp)