Re: Code Access Security
From: Richard Blewett [DevelopMentor] (richardb_at_develop.com)
Date: 10/07/04
- Next message: Robert Jordan: "Re: Problem with ICSharpCode.SharpZipLib.Zip"
- Previous message: Maxim Kazitov: "Problem with ICSharpCode.SharpZipLib.Zip"
- In reply to: tuuky: "Re: Code Access Security"
- Next in thread: Philip Rieck: "Re: Code Access Security"
- Reply: Philip Rieck: "Re: Code Access Security"
- Messages sorted by: [ date ] [ thread ]
To: microsoft.public.dotnet.framework Date: Thu, 07 Oct 2004 13:42:53 -0700
The error message you are seeing looks like a Winforms default one - can you trap the exception nearer teh site that it happens (maybe where you show the other form (if you call ShowDialog on it) so we can have a look at the exception trace and see what is generating the SecurityException
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
I see what you're saying Richard.
No COM objects... that's the weird thing about this whole mess. The failing
part of this app is just another form trying to load a grid with SQL data.
All built in .NET, part of the same project.
"Richard Blewett [DevelopMentor]" wrote:
> Hmm ... but you don't actually do any interop?
>
> Imports just saves you some typing it doesn't actually create a reference to any assemblies. The interop layer is contained in mscorlib which you will already be referencing. You don't need InteropServices to do strong naming - you need the reflection namespace for the AssemblyKeyFile attribute though.
>
> If you actually do any interop (use COM objects, have Declare statements, etc) then this would be the cause of your exception as the interop layer will issue a demand for a SecurityPermission for unmanaed code access. Partially trusted code doesn't get this permission by default and so you would get a SecurityException.
>
> Regards
>
> Richard Blewett - DevelopMentor
> http://staff.develop.com/richardb/weblog
>
> nntp://news.microsoft.com/microsoft.public.dotnet.framework/
>
> I did type it in :)
> I do have a reference (Imports) to System.Runtime.InteropServices in
> AssemlyInfo.vb
> I only added that reference as I saw it in the help files from Microsoft
> regarding creating Strong Names for assemblies.
>
>
>
> "Richard Blewett [DevelopMentor]" wrote:
>
> > I'm assuming you typed that in rather than cut and paste it - -so do you mean it required the SecurityPermission?
> >
> > Does your code use interop?
> >
> > Regards
> >
> > Richard Blewett - DevelopMentor
> > http://staff.develop.com/richardb/weblog
> >
>
>
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.771 / Virus Database: 518 - Release Date: 28/09/2004
[microsoft.public.dotnet.framework]
- Next message: Robert Jordan: "Re: Problem with ICSharpCode.SharpZipLib.Zip"
- Previous message: Maxim Kazitov: "Problem with ICSharpCode.SharpZipLib.Zip"
- In reply to: tuuky: "Re: Code Access Security"
- Next in thread: Philip Rieck: "Re: Code Access Security"
- Reply: Philip Rieck: "Re: Code Access Security"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|