Re: Security.Exception



"Diego F." <diegofrNO@xxxxxxxx> wrote in message
news:uQ$EC0$aFHA.3144@xxxxxxxxxxxxxxxxxxxxxxx
> And now how can I change the CAS settings without the .NET Configuration
> tools?

IIRC, beta 1 was one of the releases where the tools were installed even
though the start menu shortcut wasn't added. Have you tried running mmc.exe
from the command line then attempting to add the snap-in from within MMC?
If this doesn't work, you should still be able to use caspol.


> Anyway I did that before and put full permissions to the intranet zone.

That might explain why it was working. <g>

>
> --
> Regards,
>
> Diego F.
>
>
>
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
> mensaje news:ecTwIj4aFHA.2860@xxxxxxxxxxxxxxxxxxxxxxx
>> "Diego F." <diegofrNO@xxxxxxxx> wrote in message
>> news:uYcbCO4aFHA.3932@xxxxxxxxxxxxxxxxxxxxxxx
>>> Wanna hear something funny? I use the library in two methods: one sends
>>> a pdf file via http and the other saves it to disk. Now is the second
>>> that doesn't work. I gave permissions to Everyone but it gives me the
>>> error.
>>
>> What is the exact exception? If it's a SecurityException, then chances
>> are excellent that the problem is due to CAS permissions, not user
>> permissions, so no changs to the user permissions will help. You should
>> probably revert to more restrictive user permissions if you want to avoid
>> unnecessary risk.
>>
>>
>>> --
>>> Regards,
>>>
>>> Diego F.
>>>
>>>
>>>
>>> "Diego F." <diegofrNO@xxxxxxxx> escribió en el mensaje
>>> news:OAaPIy2aFHA.2180@xxxxxxxxxxxxxxxxxxxxxxx
>>>>I can't run that tool in the server. I have installed framewrok 2.0
>>>>beta2 and don't know why but there is no .net tools.
>>>>
>>>> Anyway, and don't ask me why, it's working again. It happened a few
>>>> weeks ago; suddenly it started working. I put the strong-name, that's
>>>> the only change. Since the last time it was working, I just moved the
>>>> code to other class and the error reappeared. Now it's working, don't
>>>> know how much time.
>>>>
>>>> --
>>>> Regards,
>>>>
>>>> Diego F.
>>>>
>>>>
>>>>
>>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en el
>>>> mensaje news:eG9wsC1aFHA.3848@xxxxxxxxxxxxxxxxxxxxxxx
>>>>> Strong naming it won't help. The problem is that it is partially
>>>>> trusted, not that it doesn't have a strong name. Have you tried
>>>>> verifying its permission grant using the instructions from
>>>>> http://msdn.microsoft.com/library/en-us/cptools/html/cpconNETFrameworkAdministrationToolMscorcfgmsc.asp?
>>>>>
>>>>>
>>>>>
>>>>> "Diego F." <diegofrNO@xxxxxxxx> wrote in message
>>>>> news:OFu7nnzaFHA.2688@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>I have the source of gios.dll. Should I strong name it? I tried it but
>>>>>>I found no difference.
>>>>>>
>>>>>> --
>>>>>> Regards,
>>>>>>
>>>>>> Diego F.
>>>>>>
>>>>>>
>>>>>>
>>>>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió en
>>>>>> el mensaje news:uBNUJYsaFHA.228@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>> The Gios.Pdf.Utility.Deflate method shown in the call stack is
>>>>>>> calling into the ICSharpCode.SharpZipLib.dll library assembly, which
>>>>>>> is strongly named. Given that the exception is being thrown, it
>>>>>>> would appear that the Gios Pdf.NET.dll assembly is not fully
>>>>>>> trusted. If you verify the permissions for the Gios library as
>>>>>>> described in the "To evaluate an assembly" section at
>>>>>>> http://msdn.microsoft.com/library/en-us/cptools/html/cpconNETFrameworkAdministrationToolMscorcfgmsc.asp,
>>>>>>> does it appear to be granted unrestricted permissions (full trust)?
>>>>>>> If not, can you tell why not based on its code group membership?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> "Diego F." <diegofrNO@xxxxxxxx> wrote in message
>>>>>>> news:OQsT8AsaFHA.3400@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>> Here is the stack info:
>>>>>>>>
>>>>>>>> Stack Trace:
>>>>>>>>
>>>>>>>> [SecurityException: That assembly does not allow partially trusted
>>>>>>>> callers.]
>>>>>>>>
>>>>>>>> System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly
>>>>>>>> asm, PermissionSet granted, PermissionSet refused,
>>>>>>>> RuntimeMethodHandle rmh, SecurityAction action, Object demand,
>>>>>>>> IPermission permThatFailed) +130
>>>>>>>> Gios.Pdf.Utility.Deflate(Byte[] b) in C:\Documents and
>>>>>>>> Settings\MS006\Escritorio\diego\Gios Pdf.NET\Utility.cs:81
>>>>>>>> Gios.Pdf.PdfTablePage.StreamWrite(Stream stream) in C:\Documents
>>>>>>>> and Settings\MS006\Escritorio\diego\Gios Pdf.NET\Table
>>>>>>>> Objects\PdfTablePage.cs:114
>>>>>>>> Gios.Pdf.PdfDocument.SaveToStream(Stream m) in C:\Documents and
>>>>>>>> Settings\MS006\Escritorio\diego\Gios Pdf.NET\PdfDocument.cs:237
>>>>>>>> GestorPDF.GenerarPDF(String titulo, DataTable Table, String
>>>>>>>> fichero) in
>>>>>>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\Code\Aplicacion\Gestores\GestorPDF.vb:56
>>>>>>>> ExportarDatos_aspx.ExportarPDF() in
>>>>>>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\ExportarDatos.aspx.vb:121
>>>>>>>> ExportarDatos_aspx.Page_Load(Object sender, EventArgs e) in
>>>>>>>> \\Mantelnorserv\Proyectos\Mantelnor\Bampimor\ExportarDatos.aspx.vb:25
>>>>>>>> System.Web.UI.Control.OnLoad(EventArgs e) +87
>>>>>>>> System.Web.UI.Control.LoadRecursive() +55
>>>>>>>> System.Web.UI.Page.ProcessRequestMain(Boolean
>>>>>>>> includeStagesBeforeAsyncPoint, Boolean
>>>>>>>> includeStagesAfterAsyncPoint) +6828
>>>>>>>> System.Web.UI.Page.ProcessRequest(Boolean
>>>>>>>> includeStagesBeforeAsyncPoint, Boolean
>>>>>>>> includeStagesAfterAsyncPoint) +229
>>>>>>>> System.Web.UI.Page.ProcessRequest(HttpContext context) +34
>>>>>>>>
>>>>>>>> System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
>>>>>>>> +305
>>>>>>>> System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
>>>>>>>> Boolean& completedSynchronously) +76
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>> Version Information: Microsoft .NET Framework Version:2.0.40607.16;
>>>>>>>> ASP.NET Version:2.0.40607.16
>>>>>>>>
>>>>>>>> __
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>> Diego F.
>>>>>>>>
>>>>>>>>
>>>>>>>> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> escribió
>>>>>>>> en el mensaje news:uVGcgpraFHA.1148@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>>> 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
    ... And now how can I change the CAS settings without the .NET Configuration ... I gave permissions to Everyone but it gives me the error. ... so no changs to the user permissions will help. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Question about strong-name dlls
    ... > Hi Diego, ... > permissions are different as well. ... >> - how can I activate asp.net user in Windows 2003? ... >>> Sometimes the elephant eats you. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Question about strong-name dlls
    ... Do you mean that I should manage the permissions from IIS instead that from ... > When you say "application root" you are referring to a web server virtual ... not a file system folder. ... >> Diego F. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Permission problems Need some help please
    ... We ran into an issue with user permissions on our web site. ... We installed a new drive on the server and did a secure copy to copy the old ... the new drive letter to the old one. ...
    (microsoft.public.frontpage.extensions.windowsnt)
  • Re: Setting group Permissions.
    ... >>I just want some clarifcation on group and user permissions. ... >>if i want to create a group for controlling access to a directory, ...
    (comp.security.unix)