C# – “Type is not resolved for member” SerializationException in Connection.get_LocalIP() RESOLVED!
Friday, March 5th, 2010Running a web application in the VS 2008′s built in localhost webserver using a custom IIdentity (but not a custom IPrincipal) that you set to the Thread.CurrentPrincipal using a GenericPrincipal causes an exception begining with “Type is not resolved for member” to be thrown when accessing Microsoft.VisualStudio.WebHost.Connection.get_LocalIP().
To resolve this, for your custom IIdentity class add the Serializable attribute, ComVisible(true) attribute, and make it inherit from MarshalByRefObject.
I don’t know exactly why this works, but it does.
