Strange permission issue with a UserControl
From: ejstembler (ejstembler_at_discussions.microsoft.com)
Date: 12/20/04
- Previous message: Oldman: "Refreshing Code Access Security settings after change"
- 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: Mon, 20 Dec 2004 12:41:02 -0800
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?
- Previous message: Oldman: "Refreshing Code Access Security settings after change"
- 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
|