By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,671 Members | 1,413 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,671 IT Pros & Developers. It's quick & easy.

How to load the assembly at runtime in ASP.NET application.

P: n/a
Hi!
I am trying to create one new Application Domain and
calling one Assembly in that created Application Domain.
It is working fine with stand alone application.
But I need to do the same with ASP.NET.
In brief I will explain:
I want to create one Application domain, and call one
assembly in that created application domain, and excute
some methods/functions of that calling assembly and unload
the application domain. All these things should work with
ASP.NET. Please give your code with C#.
thanks for your help.
....Raveendra
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Raveendra,

You should be able to use the same code that you do in a console
application. However, you should make sure that the permission set which
ASP.NET is running under allows the creation of a new application domain.
The ASP.NET runtime probably does not grant full trust to the assemblies
that are running in it (for obvious reasons), the creation of a new
app-domain being one of those.

You will have to check the permissions that you are granted for ASP.NET
and change them, if possible.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Raveendra" <ra*********@hotmail.com> wrote in message
news:0d****************************@phx.gbl...
Hi!
I am trying to create one new Application Domain and
calling one Assembly in that created Application Domain.
It is working fine with stand alone application.
But I need to do the same with ASP.NET.
In brief I will explain:
I want to create one Application domain, and call one
assembly in that created application domain, and excute
some methods/functions of that calling assembly and unload
the application domain. All these things should work with
ASP.NET. Please give your code with C#.
thanks for your help.
...Raveendra

Nov 13 '05 #2

P: n/a
Hi Nicholas Paldino!
Thanks for your reply. But, I could not able to success.
I am able to create new appdomain. But, I am getting error when I try to
call my assembly in the created appdomain.
I checked with the utility "fuslogvw", it is giving the error log
LOG: Processing DEVPATH.
LOG: DEVPATH is not set. Falling through to regular bind.
LOG: Attempting application configuration file download.
LOG: Policy not being applied to reference at this time (private,
custom, partial, or location-based assembly bind).
LOG: Post-policy reference: MyClass, Version=1.0.1284.27980,
Culture=neutral, PublicKeyToken=null
LOG: Attempting download of new URL
file:///C:/WINNT/system32/MyClass.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/system32/MyClass/MyClass.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/system32/MyClass.EXE.
LOG: Attempting download of new URL
file:///C:/WINNT/system32/MyClass/MyClass.EXE.
LOG: All probing URLs attempted and failed.

It is seaching my assembly in the system32 folder. If I place my
assembly in that system32 folder it is working. But I need to load the
assembly in the new domain from non system folder.
How set the policy for getting the permession.
Please list out securtiy settings.
How to made this possible.
Once againg thanks for your reply.
..Raveendra


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3

P: n/a
I assume that you've set the AppDomainSetup.ApplicationBase to the
appropriate path (away from system32) when creating the AppDomain. In that
case, it sounds like the assembly is loading fine in the target appdomain,
but failing when passed back to the calling one (or, it could be that you're
not calling onto a MarshalByRefObject). Are you calling AppDomain.Load()?
That could do it. See
http://blogs.gotdotnet.com/suzcook/P...4-7410056564cf
for info about that and
http://blogs.gotdotnet.com/suzcook/P...5-3f6c2335f035
for info about successfully executing code in another appdomain.

Suzanne Cook
My .NET CLR Loader blog: http://blogs.gotdotnet.com/suzcook/
--
Please do not respond directly to this alias. This alias is for newsgroup
purposes only. This posting is provided "AS IS" with no warranties, and
confers no rights.
"Raveendra Madupu" <ra*********@hotmail.com> wrote in message
news:uZ**************@TK2MSFTNGP11.phx.gbl...
Hi Nicholas Paldino!
Thanks for your reply. But, I could not able to success.
I am able to create new appdomain. But, I am getting error when I try to
call my assembly in the created appdomain.
I checked with the utility "fuslogvw", it is giving the error log
LOG: Processing DEVPATH.
LOG: DEVPATH is not set. Falling through to regular bind.
LOG: Attempting application configuration file download.
LOG: Policy not being applied to reference at this time (private,
custom, partial, or location-based assembly bind).
LOG: Post-policy reference: MyClass, Version=1.0.1284.27980,
Culture=neutral, PublicKeyToken=null
LOG: Attempting download of new URL
file:///C:/WINNT/system32/MyClass.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/system32/MyClass/MyClass.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/system32/MyClass.EXE.
LOG: Attempting download of new URL
file:///C:/WINNT/system32/MyClass/MyClass.EXE.
LOG: All probing URLs attempted and failed.

It is seaching my assembly in the system32 folder. If I place my
assembly in that system32 folder it is working. But I need to load the
assembly in the new domain from non system folder.
How set the policy for getting the permession.
Please list out securtiy settings.
How to made this possible.
Once againg thanks for your reply.
.Raveendra


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.