help with Security Exception ??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tarren

    #1

    help with Security Exception ??

    Hi,

    I am getting the following error:

    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 .SecurityExcept ion: Request for the
    permission of type System.Security .Permissions.St rongNameIdentit yPermission,
    mscorlib, Version=1.0.330 0.0, Culture=neutral ,
    PublicKeyToken= b77a5c561934e08 9 failed.

    What is causing this is that my app is trying to load a file from the disk.
    When I run it local from my dev server it compiles ok, but when I migrated
    it to the staging server I am getting the error above. Is there a way I can
    programmaticall y alter this from the web.config file so that I can load this
    file from the filesystem?

    The code that is causing the error is below:

    oXMLDoc = New System.Xml.XmlD ocument
    oXMLDoc.Load("d ata.xml")

    Thanks for any help!


  • Natty Gur

    #2
    Re: help with Security Exception ??

    Hi,

    Use identity tag in web.config to set user with write permission.

    <identity impersonate="tr ue" userName="conto so\Jane" password="pass" />

    Natty Gur, CTO
    Dao2Com Ltd.
    34th Elkalay st. Raanana
    Israel , 43000
    Phone Numbers:
    Office: +972-(0)9-7740261
    Fax: +972-(0)9-7740261
    Mobile: +972-(0)58-888377


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!

    Comment

    • Tarren

      #3
      Re: help with Security Exception ??

      it is 3rd party hosting? How would I go about it in that way?

      "Natty Gur" <natty@dao2com. com> wrote in message
      news:OHqqx7wWDH A.652@tk2msftng p13.phx.gbl...[color=blue]
      > Hi,
      >
      > Use identity tag in web.config to set user with write permission.
      >
      > <identity impersonate="tr ue" userName="conto so\Jane" password="pass" />
      >
      > Natty Gur, CTO
      > Dao2Com Ltd.
      > 34th Elkalay st. Raanana
      > Israel , 43000
      > Phone Numbers:
      > Office: +972-(0)9-7740261
      > Fax: +972-(0)9-7740261
      > Mobile: +972-(0)58-888377
      >
      >
      > *** Sent via Developersdex http://www.developersdex.com ***
      > Don't just participate in USENET...get rewarded for it![/color]


      Comment

      Working...