472,804 Members | 817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,804 software developers and data experts.

Problems with App Domains

Hi! Sorry for my English. :)

Please consider the following code:

----------------------------------------------------------------------------
-
System.AppDomainSetup ap_setup = new System.AppDomainSetup();
ap_setup.LoaderOptimization = System.LoaderOptimization.MultiDomain;
AppDomain ap = AppDomain.CreateDomain("DomainForWork", null, ap_setup);
System.Security.Policy.Evidence pe = new System.Security.Policy.Evidence();
pe.AddAssembly(ap);
System.Reflection.Assembly a = ap.Load("Classes", pe);
System.Type t = a.GetType( "Global" );
System.Reflection.MethodInfo mi = t.GetMethod("InitColl");
mi.Invoke(null, null);
System.AppDomainSetup ap_setup2 = new System.AppDomainSetup();
ap_setup2.LoaderOptimization = System.LoaderOptimization.MultiDomain;
AppDomain ap2 = AppDomain.CreateDomain("DomainForWork2", null, ap_setup2);
System.Security.Policy.Evidence pe2 = new System.Security.Policy.Evidence();
pe2.AddAssembly(ap2);
System.Reflection.Assembly a2 = ap2.Load("Classes", pe2);
System.Type t2 = a2.GetType( "Global" );
System.Reflection.MethodInfo mi2 = t2.GetMethod("InitColl");
mi2.Invoke(null, null);
----------------------------------------------------------------------------
-

We have dll named "Classes" and we load it in two different application
domains. Then we successfully call static method named "InitColl" in the
first domain, but if we call this method in second domain after calling it
in the first domain, we have an exception. Why call of this method in the
second domain is able to see changes that was made by it in first domain?
Does anyone know what's the problem?
Jul 21 '05 #1
0 978

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Marc Hoeve | last post by:
Hi everybody I'm setting up 2 websites for a friend of mine, en I'm have problems with one of the sites. The situation: I have 2 different domains (both in the .NL domain). Both domains...
6
by: Jeff Thies | last post by:
I have some pages where I need to use a base href tag. Mac behaviour is different than PC. I have this: <base href="http://some_domain.com" /> The page would be:...
9
by: tshad | last post by:
This is a problem that we saw before on our asp site, but don't know how to fix it. We are seeing it on our .net site also. We have our email sending from our Windows 2003 server with exchange...
1
by: Paul Fi | last post by:
I have some confusions about the two, is it possible to create threads inside a particular domain and have other threads created in another domain or do we create threads that will manipulate app...
5
by: moondaddy | last post by:
I'm setup with a new ISP where we were given an account which we could setup multiple domains. To do this we were given a root directory where we setup a folder for each domain. then we mapped...
6
by: Ludvig | last post by:
I have various domains using the same application/assembly They differ in contents and design, based on a "site id", and get its information from an SQL server. Now I have to deploy the...
7
by: Doug | last post by:
An ASP.NET session cookie set on "www.mydomain.com" can not be accessed on "search.mydomain.com"; hence, a new session and cookie are being created on every sub-domain. This is occuring because...
2
by: starfi3ld | last post by:
I got a few errors with this script Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/starfi3ld/domains/starfi3ld.com/public_html/newreleases.php on line...
3
by: alexdavies82 | last post by:
I am having a problem producing a relatively simple PHP code. Whenever I run it it gives the following fault message:
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.