.comment-link {margin-left:.6em;}

Ben Cops

Tuesday, November 09, 2004

Remoting issues with strongly named assemblies

All your assemblies are strongly named, because BTS wants them all in the GAC, right?

Therefore you'll run into this issue if you try to remote them and need to serialise (byref) your types as parameters:

System.Runtime.Serialization.SerializationException : Because of security restrictions, the type [classname] cannot be accessed.
This is new to .net 1.1.
This guy has the answer. Essentially you need to mark the serialised class as follows


//The following attribute specifies that we are happy for this assembly to be remoted
//(serialised, anyway) - in .net version 1.1 a security check is added for strongly named
//types that means that deserialisation is disallowed unless either the deserialised class's assembly
//"Allow[s]PartiallyTrustedCallers", or the typeFilterLevel of the server/deserializer set to Full.
[assembly: AllowPartiallyTrustedCallers]


1 Comments:

  • Hola was just blogging and saw your blog and thought it was nice so I should drop in and say Hola. Anyways I would be interested in exchanging links if you are up for it.

    By Anonymous Rose, at 2:36 pm  

Post a Comment

Links to this post:

Create a Link

<< Home