Click here to Skip to main content
15,890,043 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello there !

It's been a while that I'm faced to a major problem and Internet doesn't help me for the moment... Hope to find answers here !

I'm working in Visual Studio 2005 for work purpose (especially in VB.NET). I've made a custom editor to edit a special collection in a component object. Objects allowed in this collection must implement the IFoo interface. The user can extend the basic objects that implement this interface by inherit them or simply by implement IFoo in its own classes. I want to make these user classes to be part of possible items in my collection at design time. In fact, I want to reproduce the windows form editor behavior of visual studio that automatically propose to the user to add all the user controls and components (in the toolbox) coded in the edited solution, based on the last correct assemblies building.

I've tried the only way that I can think about : the reflection. I look for the last dll build by the user (mostly in the bin\debug folder) and dynamic load it in my custom editor form. It works but after that, the user can not compile its assembly while visual studio instance stay open because the file remains "used by another process". I can understand that this process is Visual Studio itself, so I've also tried to copy the dll or exe file with another name, then load this copy by reflection but same result. Btw, is there a way to "unload" the dynamic loaded assembly (I don't find it) ?

Impossible to find a similar problem on the net... I certainly not use the correct words, so I hope to find some help here ! Or if someone know how Visual Studio exposes the user controls of the last build in the toolbox of the form editor.

Thanks for all your answers !
Posted

1 solution

Well I have to answer myself to my question since I've found the solution.

Go to the very good blog of Daniel Cazzulino at http://blogs.clariusconsulting.net/kzu/how-to-get-a-system-type-from-an-envdte-codetyperef-or-envdte-codeclass/[^]

Thinks become suddently easier !
 
Share this answer
 

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