I have 2 libraries dll that have build-in access to its own remote portal. Let's called Library 'A' and Library 'B'.
Each library must be a different CslaDataPortalUrl and both libraries will work together in my main application.
I tried to configure it in runtime inside of each library's constructor, like that:
Library A:
ConfigurationManager.AppSettings["CslaDataPortalUrl"] = "http://www.mydomain1.com/Portal-A/remotingportal.rem";
Library B:
ConfigurationManager.AppSettings["CslaDataPortalUrl"] = "http://www.mydomain2.com/Portal-B/remotingportal.rem";
But ConfigurationManager is a Domain Application Configuration then Library 'B' configuration overwrites Library 'A' configuration.
Is there a way to do that?
Any help would very appreciated.
Thanks.
Jaime Barreto
You'll need to write your own custom data portal proxy to allow for more flexible configuration.
The problem goes deeper than just that the config settings are per-AppDomain. Within the data portal itself, the proxy object is also per-AppDomain.
So the only answer is to create your own variation on RemotingProxy (copy the code into your project and alter it there to avoid changing CSLA itself).
This concept has been discussed in numerous other threads - search for custom data portal proxy and you'll probably find most of them.
Copyright (c) Marimer LLC