tags:

views:

157

answers:

2

I'm getting the following error when calling a method on a C# service (connected through .net remoting).

"Because of security restrictions, the type cannot be accessed."

What is the source of this error? How can I fix it?

+1  A: 

I've seen other solutions for similar problems, but none of them were the same solution used to solve my particular problem.

Apparently I was missing an updated AssemblyInfo.cs file which includes the following statement:

[assembly: AllowPartiallyTrustedCallers]

This took care of the error for me.

Stimy
A: 

Set the Security Level for Remoting:

http://msdn.microsoft.com/en-us/library/61w7kz4b%28VS.80%29.aspx http://msdn.microsoft.com/en-us/library/ms229983.aspx

If it doesn't help, let us know the .net version you use.

ilya.devyatovsky