VB.NET CAS error

  • Thread starter Thread starter Justin Smith
  • Start date Start date
J

Justin Smith

Hello...

I wrote 2 apps - one in vb.net, another in C#. Both apps are standard
windows apps. Each one loads a library when a button is pushed. At this
point, I have 1 vb.net exe and 1 vb.net dll as well as 1 c# exe and 1 c#
dll.

I deploy the C# and VB app over the web (localhost). Both load when I call
them. The problem enters when I load the dll. The VB app fails with a
security exception, but the C# app works properly.

The VB app will work when I give the app full trust. The first C# app does
not need full trust. Is there a library that is not marked with APTCA?
What CAS switch do I need to change to make this work for VB.net?
 
Hi Justin,

Essentially, there is no difference between a VB.NET app with a c# app,
because they are all based on .net framework. After we compile the c# or
vb.net app, they are all compiled into MSIL language which is executed by
CLR engine.

So I think the problem may be caused by that the vb.net appliation are
doing different job than c# app.
I think you may try to compare the two apps and their dlls to see what is
the difference, maybe the vb.net app needs more permissions than c#.
Also here is a link you may take a look.
Security and Versioning Models in the Windows Forms Engine Help You Create
and Deploy Smart Clients
http://msdn.microsoft.com/msdnmag/issues/02/07/NetSmartClients/

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Thanks for the response. I was assuming that the Microsoft.VisualBasic
library did not allow partially trusted callers and that might be causing
the problem. I went this route after looking at the ILDASM results for the
same code generated with VB and C# - the results were not the same.

I did get around the issue finally - I cleared my download cache... I know
it sounds odd, but when I cleared the cache, the exact same library started
working as intended.

Unfortunately I did not back up the cache, so I cannot interrogate it for
clues. Have you ever heard of an issue along these lines that is resolved
by running gacutil -cdl?
 
Hi Justin,

Do you mean the VB.NET app and dll have the same code with the C# app and
the dll?
But the VB.NET will produce the security error.
Can you provide a simple reproduce sample together with detailed
information, so that we can troubleshooting the problem on our side?
I did not find any problem related with the language specific error.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi,

If you have any more concerns on it, please feel free to post here.


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top