PhilJohnson
IS-IT--Management
I have a dll that uses Rocky Lhotka's CSLA. The CSLA relies on some settings in an app.config for remoting but my dll is not used by one of my apps so I have no control over the app.config.
The point where the string is set with the url of the remote object is:
string data = ConfigurationSettings.AppSettings["PortalServer"];
and the setting in app.config is:
<add key="PortalServer" value=" />
BUT when I change the initialization of the string to be hardcoded rather than from appsettings, like this:
string data = "
I get this error at the point the code tries to create the remote object:
"The Type System.Xml.XmlDocument in Assembly System.Xml, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 is not marked as serializable."
If I switch the line back to the original one getting the url from the appsettings, it all works again..... This is the only thing I am changing and it works every time from appsettings but never when I hardcode the string!
I have tried escaping the string and casting it to a string etc, like this:
string data = (string)@"
and every time, the string variable looks exactly the same as setting it from the appsettings but I get the error when the url is hardcoded.
This is a real showstopper for me, so I would really appreciate any help that anybody can give me.
I even emailed Rocky himself but he could not think of why it could be happening.
Thanks.
--
Regards,
Phil Johnson (MCAD)
The point where the string is set with the url of the remote object is:
string data = ConfigurationSettings.AppSettings["PortalServer"];
and the setting in app.config is:
<add key="PortalServer" value=" />
BUT when I change the initialization of the string to be hardcoded rather than from appsettings, like this:
string data = "
I get this error at the point the code tries to create the remote object:
"The Type System.Xml.XmlDocument in Assembly System.Xml, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 is not marked as serializable."
If I switch the line back to the original one getting the url from the appsettings, it all works again..... This is the only thing I am changing and it works every time from appsettings but never when I hardcode the string!
I have tried escaping the string and casting it to a string etc, like this:
string data = (string)@"
and every time, the string variable looks exactly the same as setting it from the appsettings but I get the error when the url is hardcoded.
This is a real showstopper for me, so I would really appreciate any help that anybody can give me.
I even emailed Rocky himself but he could not think of why it could be happening.
Thanks.
--
Regards,
Phil Johnson (MCAD)