I am trying to create an add-in in Visual Studio. Anytime I reboot my
computer (or log off), I get an error when I try to re-build the add-in
as it says that it's being used by another process. I have to get out
of the add-in, delete the DLL that's been built and then try again.
But then the add-in stops showing up in the tool menu item. Could
someone tell me what I'm doing wrong as well as how to re-add the
add-in so that it shows up again in the tool menu item? I tried to use
the Add-In manager and that isn't working.
Hi Doug,
>I am trying to create an add-in in Visual Studio. Anytime I reboot my
> computer (or log off), I get an error when I try to re-build the add-in
> as it says that it's being used by another process. I have to get out
> of the add-in, delete the DLL that's been built and then try again.
If you have the add-in marked to load on startup, in the next session the
add-in is loaded in the IDE that you use to build the add-in. Since the
add-in is loaded, the compiler can not replace the dll and therefore the
error. If you go to the add-in manager and unload it, the dll is still
loaded on the appdomain, because assemblies can not be unloaded from
appdomains. So, you need to mark the add-in not to load on startup, close
VS.NET to unload the appdomain and open it again.
> But then the add-in stops showing up in the tool menu item. Could
> someone tell me what I'm doing wrong as well as how to re-add the
> add-in so that it shows up again in the tool menu item? I tried to use
> the Add-In manager and that isn't working.
See my article:
INFO: Visual Studio .NET Add-In Commands Disappear On Next Session
http://support.microsoft.com/default.aspx?scid=kb;en-us;555321

Signature
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
I have just written a MSDN Knowledge Base article about your first question
and a tip to avoid it (it can time some minutes to appear):
PRB: "Could not copy temporary files to the output directory" error building
VS.NET add-in.
http://support.microsoft.com/default.aspx?scid=kb;en-us;555431

Signature
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
>I am trying to create an add-in in Visual Studio. Anytime I reboot my
> computer (or log off), I get an error when I try to re-build the add-in
[quoted text clipped - 4 lines]
> add-in so that it shows up again in the tool menu item? I tried to use
> the Add-In manager and that isn't working.
Doug - 18 Aug 2005 17:40 GMT
Hi Carlos,
Thank you very much. That turned out to be very helpful.
Doug
Doug - 25 Aug 2005 15:30 GMT
Hi,
This is no longer working like it did. In the morning I would have
to basically open the app, switch the add-in to not load at startup,
get out of the app and come back in and I'd be fine (but I then have to
mark it as load at startup again at that point or I could never test
it).
Now I run into this problem after every test of the application. I
go through the steps in your article, run my tests, make a change, try
again and then I get the error I originally mentioned and I have to
repeat your steps in the article again.
Do you have any other suggestions?
Carlos J. Quintero [VB MVP] - 29 Aug 2005 15:10 GMT
The Dll can not be regenerated because someone is locking it. There are only
2 candidates, both of them the devenv.exe process:
- The debugged IDE (second instance) that loads the binary add-in. When you
exit the second instance of the IDE, its devenv.exe process should
disappear. Use the Task Manager to ensure this is the case.
- The debugger IDE (first instance) that loads the add-in source code and
builds it. There can be several causes for a single instance of the IDE to
lock a dll. See:
The "could not copy temporary files to the output directory" error is
generated in Visual Studio .NET
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B311491
In general your problem should not happen. I have being doing add-ins for
very long time and the only reason that I've seen to reach a Dll lock is the
one that I exposed in my own article or errant devenv.exe instances that
were not shut down properly.

Signature
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
> Hi,
> This is no longer working like it did. In the morning I would have
[quoted text clipped - 9 lines]
>
> Do you have any other suggestions?