Ask a Question related to ASP.NET Security, Design and Development.
-
CJ Taylor #1
Windows Control w/in ASP.NET 2.0 Permissions Problem
Alright, so my admin and I are trying to get this thing to work...
I'll just lay it out for you, no point in trying to hide what I'm doing.
We are using/switching to Microsoft SQL Reporting Services 2000. For those
of you that use it, you know its a fantastic product. EXCEPT you can't
print on the web. Yes, MS keeps saying "oh yeah...we'll put that in there".
Of course these are the same people that said "Oh yeah. Yukon will be out
in 2003."
So, given I sold my boss on the idea, I now have to create a way to print.
I thought, yeah, we could do it on the server, but you have to do a lot of
B.S. work to make it happen, plus install all the printers on the server,
unless I do some tricks with AD, which I don't really want to do.
So, I develop a Windows Contorl that I want to place in my ASP.NET web form
using the <object> tag. Simple combo box that will call the rendering from
report services.
Good, that works fine, got it working.. except when I try to enumerate
through the InstalledPrinters list on the users computer, I get a
SecurityException
I've tried trusting the assembly. I don't know what I'm doing wrong or
where to look. I thought this was supposed to work fine on the localhost,
however its not. Is there some documetation I can read somewhere that
really explains this?
Thanks,
CJ
This is what I get...
-----------------------------------------------------------------------
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Security.SecurityException: Request for the permission of type
'System.Drawing.Printing.PrintingPermission, System.Drawing,
Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
failed.
at System.Security.CodeAccessSecurityEngine.Check(Per missionToken
permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32
checkFrames, Int32 unrestrictedOverride)
at System.Security.CodeAccessSecurityEngine.Check(Cod eAccessPermission
cap, StackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.Drawing.Printing.PrinterSettings.get_Instal ledPrinters()
at MSRSReportPrinter.ucSelectPrinter.ucSelectPrinter_ Load(Object sender,
EventArgs e)
at System.Windows.Forms.UserControl.OnLoad(EventArgs e)
at System.Windows.Forms.UserControl.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.UserControl.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at
System.Windows.Forms.ActiveXImpl.System.Windows.Fo rms.IWindowTarget.OnMessag
e(Message& m)
at
System.Windows.Forms.ActiveXImpl.System.Windows.Fo rms.IWindowTarget.OnMessag
e(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Drawing.Printing.PrintingPermission
The Zone of the assembly that failed was:
Trusted
CJ Taylor Guest
-
Permissions problem accessing SQL Server from Web Service on Windows 2003
I have a Web Service that accesses a SQL Server database. IIS, SQL Server and the Web Service are all running on the same machine. As I have... -
COM+ Permissions problem migrating to Windows 2003
Migrating a VC++ COM+ application to Windows 2003, and we are unable to get the app to startup except when the Identity user is given Administrator... -
Problem with ValidationSummary Control in Windows 2003
Why windows 2003 cannot run script at client ? In Windows 2003, some client script generated from .NET i.e. RequireFieldValidator,... -
Remoting Problem when Hosting Windows Control in IE
I am hosting a Windows User Control hosted in IE, all the depended dlls for UserControl are in Server's GAC. When the client browses from different... -
ASP.NET, IIS 6.0 (Windows Server 2003) and Com permissions...
I have an ASP.NET application that instantiantes a Win32 C++ Com object. This object's methods require specific access permissions to the...



Reply With Quote

