System.UnauthorizedAccessException: When writing XMLSchema

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

    System.UnauthorizedAccessException: When writing XMLSchema

    I get a security error when trying to write out to an XMLSchema file
    "myDs.WriteXmlS chema(strXMLSch emaFile)". I am running XP SP2, No Domain, MS
    file and print sharing uninstalled. I was able to get past this by making
    ASPNET part of the Administrators group. I tried the Power User group (as
    well as others) to no avail. I also had to install MS file and print
    sharing in order to even add ASPNET
    as a member of the Administrator group (or any other group). After adding it
    to the group I can uninstall file and print sharing and everything works
    fine.

    Is making ASPNET a member of the Admin group the correct way of doing this,
    or should I make a new group with some specific permissions?

    I am trying to learn .NET programming and trying to avoid going on security
    tangents. Is this news group the right place or is there a more suitable
    place for Newbie's.


  • Chris

    #2
    Re: System.Unauthor izedAccessExcep tion: When writing XMLSchema

    101 wrote:[color=blue]
    > I get a security error when trying to write out to an XMLSchema file
    > "myDs.WriteXmlS chema(strXMLSch emaFile)". I am running XP SP2, No Domain, MS
    > file and print sharing uninstalled. I was able to get past this by making
    > ASPNET part of the Administrators group. I tried the Power User group (as
    > well as others) to no avail. I also had to install MS file and print
    > sharing in order to even add ASPNET
    > as a member of the Administrator group (or any other group). After adding it
    > to the group I can uninstall file and print sharing and everything works
    > fine.
    >
    > Is making ASPNET a member of the Admin group the correct way of doing this,
    > or should I make a new group with some specific permissions?
    >
    > I am trying to learn .NET programming and trying to avoid going on security
    > tangents. Is this news group the right place or is there a more suitable
    > place for Newbie's.
    >
    >[/color]

    I think the easiest way to solve this is to just fully trust your
    assembly in the .Net Config Wizard (in your administrative tools).

    Chris

    Comment

    • 101

      #3
      Re: System.Unauthor izedAccessExcep tion: When writing XMLSchema

      That sounded like it, but I am getting the same error. I used the wizard to
      fully trust C:\Inetpub\wwwr oot\VBNET\Manag ingData\bin\Man agingData.dll

      but got the error "System.Unautho rizedAccessExce ption: Access to the path
      "c:\inetpub\www root\VBNET\Mana gingData\Catego riesProductsSch ema.xsd" is
      denied. at System.IO.__Err or.WinIOError(I nt32 errorCode, String str) at
      System.IO.FileS tream..ctor(Str ing path, FileMode mode, FileAccess access,
      FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean
      bFromProxy) at System.IO.FileS tream..ctor(Str ing path, FileMode mode,
      FileAccess access, FileShare share) at System.Xml.XmlT extWriter..ctor (String
      filename, Encoding encoding) at System.Data.Dat aSet.WriteXmlSc hema(String
      fileName) at ManagingData.Ed itProducts.btnS ave_Click(Objec t sender,
      EventArgs e) in
      c:\inetpub\wwwr oot\VBNET\Manag ingData\EditPro ducts.aspx.vb:l ine 574"

      Like I said, when ASPNET is a member of Admin it works, is there something
      else I need to Fully Trust?
      "Chris" <no@spam.com> wrote in message
      news:uIe4YX2QFH A.1932@tk2msftn gp13.phx.gbl...[color=blue]
      > 101 wrote:[color=green]
      >> I get a security error when trying to write out to an XMLSchema file
      >> "myDs.WriteXmlS chema(strXMLSch emaFile)". I am running XP SP2, No Domain,
      >> MS file and print sharing uninstalled. I was able to get past this by
      >> making ASPNET part of the Administrators group. I tried the Power User
      >> group (as well as others) to no avail. I also had to install MS file and
      >> print sharing in order to even add ASPNET
      >> as a member of the Administrator group (or any other group). After adding
      >> it to the group I can uninstall file and print sharing and everything
      >> works fine.
      >>
      >> Is making ASPNET a member of the Admin group the correct way of doing
      >> this, or should I make a new group with some specific permissions?
      >>
      >> I am trying to learn .NET programming and trying to avoid going on
      >> security tangents. Is this news group the right place or is there a more
      >> suitable place for Newbie's.[/color]
      >
      > I think the easiest way to solve this is to just fully trust your assembly
      > in the .Net Config Wizard (in your administrative tools).
      >
      > Chris[/color]


      Comment

      • 101

        #4
        Re: System.Unauthor izedAccessExcep tion: When writing XMLSchema

        FYI - Actually Fully Trusting the assembly did help but it appears that file
        and print sharing on XP PRO must be installed and the folder containing the
        document must be shared on the network with write privliges.

        IOW - you must Fully Trust the APP and Allow network users to change my
        files.

        "Chris" <no@spam.com> wrote in message
        news:uIe4YX2QFH A.1932@tk2msftn gp13.phx.gbl...[color=blue]
        > 101 wrote:[color=green]
        >> I get a security error when trying to write out to an XMLSchema file
        >> "myDs.WriteXmlS chema(strXMLSch emaFile)". I am running XP SP2, No Domain,
        >> MS file and print sharing uninstalled. I was able to get past this by
        >> making ASPNET part of the Administrators group. I tried the Power User
        >> group (as well as others) to no avail. I also had to install MS file and
        >> print sharing in order to even add ASPNET
        >> as a member of the Administrator group (or any other group). After adding
        >> it to the group I can uninstall file and print sharing and everything
        >> works fine.
        >>
        >> Is making ASPNET a member of the Admin group the correct way of doing
        >> this, or should I make a new group with some specific permissions?
        >>
        >> I am trying to learn .NET programming and trying to avoid going on
        >> security tangents. Is this news group the right place or is there a more
        >> suitable place for Newbie's.[/color]
        >
        > I think the easiest way to solve this is to just fully trust your assembly
        > in the .Net Config Wizard (in your administrative tools).
        >
        > Chris[/color]


        Comment

        • 101

          #5
          Re: System.Unauthor izedAccessExcep tion: When writing XMLSchema

          Ok, 4 years with XP and didn't know about shutting off simplified
          permissions on folders. :(

          So, Fully Trust the assembly, shut off simplified permissions and give ASP
          ..NET Write permission on the file.

          Microsoft Support is here to help you with Microsoft products. Find how-to articles, videos, and training for Microsoft Copilot, Microsoft 365, Windows 11, Surface, and more.


          Thank You!
          "101" <AceMagoo61@yah oo.com> wrote in message
          news:qQu8e.1871 6$Xm3.7007@trnd ny01...[color=blue]
          >I get a security error when trying to write out to an XMLSchema file
          >"myDs.WriteXml Schema(strXMLSc hemaFile)". I am running XP SP2, No Domain, MS
          >file and print sharing uninstalled. I was able to get past this by making
          >ASPNET part of the Administrators group. I tried the Power User group (as
          >well as others) to no avail. I also had to install MS file and print
          >sharing in order to even add ASPNET
          > as a member of the Administrator group (or any other group). After adding
          > it to the group I can uninstall file and print sharing and everything
          > works fine.
          >
          > Is making ASPNET a member of the Admin group the correct way of doing
          > this, or should I make a new group with some specific permissions?
          >
          > I am trying to learn .NET programming and trying to avoid going on
          > security tangents. Is this news group the right place or is there a more
          > suitable place for Newbie's.
          >[/color]


          Comment

          Working...