Click here to Skip to main content
15,890,399 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I developed add-in for visual studio 2010.
I am searching some way to run add-in from another add-in in the same visual studio instance.
Does it possible?
If yes please explain how \ give code example.

Thx.
Posted
Comments
Sergey Alexandrovich Kryukov 7-Apr-14 19:01pm    
Why?
The trouble is: what if the add-in you want to use is not installed. What do you want to do with it?
Anyway, are both add-ins yours?
—SA
Member 10378909 8-Apr-14 0:47am    
Hi,

Yes, both add-ins install.
I need it in the case when i want to update my add-in (replace dlls).
So i will run the first add-in, that call to the second one.
The first add-in can close the second add-in and in that case i can replace dlls.
VS doesnt allows to replace dlls whan it is runs (even when it is disable from add-in manger).

thx
Sergey Alexandrovich Kryukov 8-Apr-14 1:32am    
This is not VS, .NET does not allow to unload DLL. You can unload a DLL if it is in the separate application domain, by unloading whole domain. I don't know if it can help you; I have trouble understanding your scenario.
—SA
Member 10378909 8-Apr-14 4:54am    
VS - visual studio 2010.
What do you mean "separate application domain"?
Can you explain more about it?

Ggenerally,
1. Does .net have unload function?
2. If i need to update some dll what do i need to do?
Sergey Alexandrovich Kryukov 8-Apr-14 11:33am    
Read about AppDomain class and you will understand.
1) what is it supposed to do?
2) during runtime, you cannot; all modules loaded are protected by OS
We can discuss your problems only if your explain your ultimate goals, otherwise this would be a waste of time.
—SA

1 solution

I don't think you can do it without closing VS. However, I am not familiar with the domain structure of the VS application; theoretically speaking, it could be possible, but would create a performance and redundant complexity problem: working through the domain wall is inherently complex and involves IPC-like communication, because Application Domains are isolated from each other, pretty much like processes; they work in separate address spaces. So, if I was the architect of the Visual Studio, I would not add this complexity, because reloading Visual Studio would be a reasonable solution. Note that, in same cases, Visual Studio is unloaded and then automatically restarted. This is very indicative.

See also:
http://msdn.microsoft.com/en-us/library/yb506139%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.appdomain.aspx[^].

So, sorry for not 100% complete and not 100% certain solution. I cannot say "I am sure: replacing of the add-in implementation without reloading of Visual Studio is totally impossible". I can only say: in my opinion, this feature is highly unlikely. I really advise you not trying to achieve that. Unloading Visual Studio and loading it again is not a great burden you would put on your users.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900