Problem calling gdi32 from ASP.NET via Xsl

From: Matt (Matt_at_discussions.microsoft.com)
Date: 11/19/04


Date: Fri, 19 Nov 2004 13:35:56 -0800

I have a component that makes call to gdi32 through a DLLImport. This call
is failing with the following exception:

gmCompose.buildFeatureCollection()(17||Error [Request for the permission of
type System.Security.Permissions.SecurityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed.], [ at
System.Security.SecurityRuntime.FrameDescHelper(FrameSecurityDescriptor
secDesc, IPermission demand, PermissionToken permToken)
   at System.Security.CodeAccessSecurityEngine.Check(PermissionToken
permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32
checkFrames, Int32 unrestrictedOverride)
   at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission
cap, StackCrawlMark& stackMark)
   at System.Security.CodeAccessPermission.Demand()
   at System.Drawing.Graphics.ReleaseHdc(IntPtr hdc)
   at CMT.Compose.addElementToFeatures(ArrayList& Features, String FontFace,
Int32 FontSize, String Delimiter, Int32 Rank, String Value, String Name,
Int32& HighestRank)
   at CMT.Compose.buildFeatureCollection(XmlNode xmlParagraph, Hashtable
htParaStyle, ArrayList& alFeatures, Int32& HighestRank, Hashtable&
htElements)]

This works on two machines here, but not on two others. I have looked for
commonality between OS, .NET Security Config, user permissions,
machine.config processModel usernames, etc...

The Compose object is created in the web's .NET code behind, and passed into
an Xsl document as a parameter. The contents of the Xsl doc then call the
various methods of the component. The Compose class itself generated the
above error. Any help would be appreciated!



Relevant Pages

  • Calling mscorlib from web - Security Errors
    ... permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 ... The Compose object is created in the web's .NET code behind, ... an Xsl document as a parameter. ...
    (microsoft.public.dotnet.security)
  • Re: Request for permission type failed
    ... In order to give your program the permissions you need, go to the .NET Administration applet and add a new permission set that corresponds to your application. ... DataGridView are read and writen to the .XML using DataSet.ReadXml ... StackCrawlMark& stackMark, Boolean isPermSet) ... access, Int32 rights, Boolean useRights, FileShare share, Int32 ...
    (microsoft.public.dotnet.languages.csharp)
  • Security Error
    ... To grant this application the required permission ... Exception Details: System.Security.SecurityException: Request for the ... CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, ... Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior ...
    (microsoft.public.de.inetserver.iis.asp)
  • Security Error
    ... I have a ASP.net application that work fine with IIS 5.0. ... To grant this application the required permission ... CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, ... Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Web Service that calls an external Web Service
    ... Request for the permission of type ... > permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 ... > at System.Net.HttpRequestCreator.Create(Uri Uri) ... > String NombreProducto, Int32 NoOrden, String NombreAutoriza, Int32 ...
    (microsoft.public.windows.server.security)