Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 23-Apr-12 5:32am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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 !
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 285
1 DamithSL 265
2 CPallini 195
3 Maciej Los 175
4 George Jonsson 170
0 OriginalGriff 5,415
1 DamithSL 4,422
2 Maciej Los 3,820
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,911


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 23 Apr 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100