Attributes in a class module

C

Chris Dunaway

I am using a PropertyGrid with some classes that have custom Type
Descriptor attributes. The attributes change how the PropertyGrid displays
the properties of the object.

The folder structure for my app is this:

MainAppFolder
|
-- Modules
|
-- Module1
CustomClasses.dll
CustomAttributes.dll


If I leave the CustomAttributes.dll in the Module1 folder, then the
PropertyGrid does not apply the attributes, although there is no error. If
I move the CustonAttributes.dll to the MainAppFolder, then the attributes
are applied correctly.

I would like to keep all the files for each module in its own folder. The
main app scans through the folders in the Modules folder and loads each
module (using an Interface). I want the modules to be independent and do
not want them to put any of their files into the MainAppFolder.

Can anyone offer any reason for this behavior? Is it possible to include
the Module directories in the MainApps search path when it tries to look
for the CustomAttributes dll?

Thanks,

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
C

Chris Dunaway

Can anyone offer any reason for this behavior? Is it possible to include
the Module directories in the MainApps search path when it tries to look
for the CustomAttributes dll?

After a little searching, I found a solution. I used the following line of
code after loading the module:

AppDomain.CurrentDomain.AppendPrivatePath(sFolder)

and that did the trick.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top