Re: Security.Exception



This exception is thrown by the version 2.0 .NET Framework when an assembly
that is not fully trusted calls attempts to call into a strongly named
assembly that is not marked with AllowPartiallyTrustedCallersAttribute. (A
far more obscure exception is thrown in the v. 1.x Framework.) This is
meant to prevent certain kinds of attacks in which fully trusted code might
be tricked into running potentially dangerous operations on behalf of code
with more restricted permissions.

Based on the error output you provided, it seems a little unlikely that the
partially trusted assembly that is causing the problem is actually your web
application. If this were the case, the exception should have been thrown
for the first line of code in which any use of the assembly in which the
type of your myPdfDocument object is declared. However, given that this is
happening on a beta platform, there could very well be a problem in the
exception details output. To rule out this possibility, might you be able
to trap the exception so that its full details (including the call stack
listing) could be captured via its ToString method?



"Diego F." <diegofrNO@xxxxxxxx> wrote in message
news:OBFTZAraFHA.1940@xxxxxxxxxxxxxxxxxxxxxxx
> The complete error message:
>
> Security Exception
> Description: The application attempted to perform an operation not allowed
> by the security policy. To grant this application the required permission
> please contact your system administrator or change the application's trust
> level in the configuration file.
>
> Exception Details: System.Security.SecurityException: That assembly does
> not allow partially trusted callers.
>
> Source Error:
>
>
> Line 54: fichero))
> Line 55: HttpContext.Current.Response.ContentType =
> "application/pdf"
> Line 56:
> myPdfDocument.SaveToStream(HttpContext.Current.Response.OutputStream)
> Line 57: HttpContext.Current.Response.End()
> Line 58:
>
>
> Source File:
> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\Aplicacion\Gestores\GestorPDF.vb
> Line: 56
>
> --
> Regards,
>
> Diego F.
>
>
>
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
> mensaje news:%23V1Ny9qaFHA.2996@xxxxxxxxxxxxxxxxxxxxxxx
>> What is the exact exception you are seeing? (If possible, could you
>> please provide the full output from the exception's ToString method?)
>>
>>
>> "Diego F." <diegofrNO@xxxxxxxx> wrote in message
>> news:uMQmr3qaFHA.3120@xxxxxxxxxxxxxxxxxxxxxxx
>>>I think I'll never come across that error. It happens when running code
>>>from a DLL that tries to write to disk. I added permissions in the
>>>project folder, the wwwroot and in IIS to NETWORK_SERVICE and Everyone,
>>>with Full Control to see if it's a permissions problem.
>>>
>>> The project is hosted in a Windows 2003 Server and developed from PCs in
>>> a domain, developing with Visual Studio 2005 Beta 1.
>>>
>>> --
>>> Regards,
>>>
>>> Diego F.
>>>
>>>
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: Security.Exception
    ... Given that the exception is being thrown, ... > does it appear to be granted unrestricted permissions? ... >> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +229 ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Security.Exception
    ... The Gios.Pdf.Utility.Deflate method shown in the call stack is calling into ... Given that the exception is being thrown, it would appear that the Gios ... does it appear to be granted unrestricted permissions? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Validating file names
    ... running Novel, from your G: running Linux file system, from your H: running ... I am not saying one does not exist! ... file file and handle any exceptions that were thrown. ... If an exception is thrown then the specified ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Using an ActiveX ocx control on a Webform
    ... > download the ActiveX I can Automate the ActiveX object through the ... > Exception of type InvalidActiveXStateException was thrown. ... > tried using the item in the design mode of a regular .NET Windows ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Exception-Objekt freigeben
    ... When an exception is thrown, the exception object that is thrown is destroyed ... we have added the AcquireExceptionObject and ReleaseExceptionObject functions. ... then the thrown object is not destroyed by the RTL, but assumed to be in control ...
    (de.comp.lang.delphi.misc)

Loading