COM Calling C# Security Issue

  • Thread starter Thread starter Matthew Wieder
  • Start date Start date
M

Matthew Wieder

We have a C# class which creates a TCP connection to another machine.
We registered that .NET class for COM use, and when we call it via COM
(it happens to be via VBA, but that shouldn't matter) the code fails
when it tries to create the new tcp connection, with a "Request for the
permission of type System.Net.SocketPermission ... failed" message.
Could someone explain what exactly the issue is and how we can solve it?
thanks!
 
Matthew,

What is the environment that you are running the VB code in? Does the
user account which the process is running under have the appropriate rights
to access the network? If you are using say, ASP.NET, by default, you won't
have this right. Or, if it is a service, and you are running under the
LocalSystem account, you won't have this right either.

Hope this helps.
 
It's VBA, and I'm running it by executing a sub in an Excel workbook.
I, the logged in user, am an admin on both boxes and have network rights.
 
Matthew,

Since the assembly is strong named, I would go to the .NET admin tool
and give this assembly full trust, and see if that works.
 
Back
Top