Home All Groups Group Topic Archive Search About

Dynamic load ascx control when DLL not in "/bin"

Author
15 May 2005 12:01 PM
malz malz via .NET 247
I try to make a framework in asp.net which will be able to manage some ascx components.
I use a httphandler to render my webform, and fill it dynamically with ascx components (with loadcontrol).
A "ascx components" is as ascx page and its "DLL codebehind".

It works like a charm when DLLs of ascx are placed in the "/bin folder".
I'd like to be able to place them, (ascx+DLL together)  in a subfolder of "/plugins folder".
But when i done that i've got a parse error :
"Parser Error Message: Could not load type 'XXX.YYY'"

Because asp.net is not able ton find the assemblies ...

- i've already tried to do AppDomain.CurrentDomain.AppendPrivatePath("plugins/A;plugins/B;plugins/C"), but it doesn't do nothing.
- i know it could be possible to do it by hacking the machine.config or web.config. But i'd like to it in my code !

Do you know a solution to tell asp.net to be able to find the DLLs of my ascx, without putting then in the bin folder of my root ???

thanx a lot
malz

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>UAl2SwQve06xYwXqXUne3g==</Id>

Author
18 May 2005 1:14 AM
Brock Allen
Unfortunately this is pretty much fixed. The best option you have is to create
a directory under bin with the same name as your assembly, but I have a feeling
this isn't what you're looking for.

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> I try to make a framework in asp.net which will be able to manage some
> ascx components.
>
> I use a httphandler to render my webform, and fill it dynamically with
> ascx components (with loadcontrol).
>
> A "ascx components" is as ascx page and its "DLL codebehind".
>
> It works like a charm when DLLs of ascx are placed in the "/bin
> folder".
> I'd like to be able to place them, (ascx+DLL together)  in a subfolder
> of "/plugins folder".
> But when i done that i've got a parse error :
> "Parser Error Message: Could not load type 'XXX.YYY'"
> Because asp.net is not able ton find the assemblies ...
>
> - i've already tried to do
> AppDomain.CurrentDomain.AppendPrivatePath("plugins/A;plugins/B;plugins
> /C"), but it doesn't do nothing.
>
> - i know it could be possible to do it by hacking the machine.config
> or web.config. But i'd like to it in my code !
>
> Do you know a solution to tell asp.net to be able to find the DLLs of
> my ascx, without putting then in the bin folder of my root ???
>
> thanx a lot
> malz
> -----------------------
> Posted by a user from .NET 247 (http://www.dotnet247.com/)
> <Id>UAl2SwQve06xYwXqXUne3g==</Id>
>