docflied Posted December 31, 2009 Posted December 31, 2009 Hey everyone, Wish you merry Xmas and an excellent 2010 Well once again need ur help and advices to understand a tricky issue. I got a shared assembly (say SharedAssembly.dll) installed in the GAC, this assembly exposes a module (static class vb equivalent) called CustomSettings inluding some properties to set Log path, DataBase connection string and some other behavior stuff. Say u have a ASP.NET web service referecing this SharedAssembly.dll Say u have a .Net application referencing the web serivce and SharedAssemlbly.dll Before calling any web service method, the .Net application assign values to exposed and shared properties. Once the web service called and within it, obviously the effective referenced assembly is not the typically the same (shadow copy done by binding mechanism thought?) and all initialization done in the .net application before calling the web service is useless! Thought that is ASP.NET application dedicated AppDomain isolate the referenced dll. How may I work around this ? Allready passed a huge amount of time reading and reading, but can't find the best way to do this properly. Thank u for ur hêlp Quote
Administrators PlausiblyDamp Posted December 31, 2009 Administrators Posted December 31, 2009 Each application will have the dll loaded into it's own memory space and any changes are local to it's address space. If you need to share data between two .Net applications (more accurately Application Domains) you would need to use some form of interprocess communication (remoting, sockets etc.) Out of interest what kind of information is being stored / used with these shared properties? There may be an alternate way of achieving what you are after. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
docflied Posted December 31, 2009 Author Posted December 31, 2009 Thank u for ur help. Shared data are : Data base connection string (String) Log path (String) Log verbosity (Enumeration) Ok a related question, assuming that the web service referencing the shared and GACed dll creates its own AppDomain (own sandbox) Is there a simple way to tell a .net application (winform or class library or another ASP.NET application) to run into the same AppDomain (joining the remote domain?) Quote
Administrators PlausiblyDamp Posted December 31, 2009 Administrators Posted December 31, 2009 Would it not be easier to store this information in a configurration file of some sort and have the winforms application just edit this shared file? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
docflied Posted December 31, 2009 Author Posted December 31, 2009 Surely easier. In this case the opened connection to the database in the web service and the opened one in the winforms are kept duplicated, same thing for Log file stream. When u asked kind of shared information I didn't precised need of sharing same Database connection. Sorry for that. Guess no way to this without exchanging interprocesses as u mentioned. Hesistating between .Remoting and WCF. I think I'll first read more about all this stuff, cause I dont master context and AppDomain in .net but I think it should be similar patterns as Java Once again thank u, and hope u a very Happy New Year. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.