Re: Strange permission issue with a UserControl
From: ejstembler (ejstembler_at_discussions.microsoft.com)
Date: 12/21/04
- Next message: Jiho Han: "winforms app security problem (runtime vs. SDK)"
- Previous message: Nicole Calinoiu: "Re: Strange permission issue with a UserControl"
- In reply to: Nicole Calinoiu: "Re: Strange permission issue with a UserControl"
- Next in thread: Nicole Calinoiu: "Re: Strange permission issue with a UserControl"
- Reply: Nicole Calinoiu: "Re: Strange permission issue with a UserControl"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 21 Dec 2004 08:03:02 -0800
It's a custom delegate (and corresponding custom EventArgs) which is declared
in the referenced assembly (dll). The UserControl in the WinForms assembly
(exe) implements the delegate as an event.
The error messages are indicitive of it having less rights, such as the
Local Network Zone, or Internet Zone. Even if I change both assemlies to
FullTrust using the "Trust an Assembly" wizard it has no effect. In fact, I
don't even see them listed when I run caspol.exe -lf
I'll post the error messages later today...
"Nicole Calinoiu" wrote:
> Events cannot be directly declared within an assembly, so what exactly do
> you mean by "it exposes a public event which declared in another assembly"?
> Is only the delegate declared in the other assembly? Does the UserControl
> implement an interface declared in the other assembly, and the interface
> defines the event? Does the UserControl inherit from a base class defined
> in the other assembly, and the base class defines the event? A combination
> of the above? Something else entirely?
>
> Also, would it be possible for you to provide the full exception details as
> retrieved from a call to its ToString method?
>
>
> "ejstembler" <ejstembler@discussions.microsoft.com> wrote in message
> news:530F047D-6260-49CF-9F75-FEA841FE125C@microsoft.com...
> > I'm encountering a strange permission issue with a custom UserControl...
> >
> > The UserControl is part of a WinForms project (exe), however it exposes a
> > public event which declared in another assembly (dll). Nothing out of the
> > ordinary there. A winform (FormMain) in the exe project contains the
> > custom
> > UserControl on it, and implements the event. In the event, I call another
> > method which calls a stored procedure and displays a MessageBox if it
> > fails.
> > If I call that method from any other method in the form (such as
> > FormMain_Load) it works fine. If the method is called from the
> > UserControl
> > event it throws a SqlClientPermission error (which is never displayed) and
> > then a UIPermission error when the MessageBox is attempted to be
> > displayed.
> > I'm assuming that the UserControl has less rights for some reason; but
> > why?
> > It's almost acting like it's treating it as though it's in another less
> > trusted zone (such as Local Network, or Internet). Both the WinForm
> > assembly
> > (exe) and the referenced assembly (dll) are on the local computer. Even
> > if I
> > grant FullTrust to all of the assemblies in question, the .Net run-time
> > still
> > displays the security exception dialog.
> >
> > Any ideas?
>
>
>
- Next message: Jiho Han: "winforms app security problem (runtime vs. SDK)"
- Previous message: Nicole Calinoiu: "Re: Strange permission issue with a UserControl"
- In reply to: Nicole Calinoiu: "Re: Strange permission issue with a UserControl"
- Next in thread: Nicole Calinoiu: "Re: Strange permission issue with a UserControl"
- Reply: Nicole Calinoiu: "Re: Strange permission issue with a UserControl"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|