Professional Web Applications Themes

IIS Virtual Directory Create Failure in Web Service :( - ASP.NET Security

System.UnauthorizedAccesception: Access is denied. at System.DirectoryServices.Interop.IAds.SetInfo() at System.DirectoryServices.DirectoryEntry.CommitChan ges() at CreateVirtualDirectories.Dal.CreateWebVirtualDirec tory.Create .... tried on the local development box and it had issues like this until I gave permissions like described in Article ID 329986, scroll down, Method A. It is a double hop as I did the test at the bottom in the Quick Test section. Code snippets: Web.config for web service having the error shown above... <identity impersonate="true" /> .... SCHEMA= "IIsWebVirtualDir"; mRootSubPath = "/W3SVC/1/Root"; .... DirectoryEntry deRoot= new DirectoryEntry("IIS://" + "localhost" + mRootSubPath,winAcctId,winAcctPwd,AuthenticationTy pes.Secure); .... if (Directory.Exists("c:\temp\Eskimo\") == false) { Directory.CreateDirectory("c:\temp\Eskimo\"); } deRoot.RefreshCache(); DirectoryEntry deNewVDir = deRoot.Children.Add("Eskimo",mSchema); ...

  1. #1

    Default IIS Virtual Directory Create Failure in Web Service :(


    System.UnauthorizedAccesception: Access is denied.
    at System.DirectoryServices.Interop.IAds.SetInfo()
    at System.DirectoryServices.DirectoryEntry.CommitChan ges()
    at CreateVirtualDirectories.Dal.CreateWebVirtualDirec tory.Create

    ....

    tried on the local development box and it had issues like this

    until I gave permissions like described in Article ID 329986, scroll down,
    Method A.

    It is a double hop as I did the test at the bottom in the Quick Test section.



    Code snippets:

    Web.config for web service having the error shown above...

    <identity impersonate="true" />
    ....

    SCHEMA= "IIsWebVirtualDir";
    mRootSubPath = "/W3SVC/1/Root";

    ....

    DirectoryEntry deRoot= new DirectoryEntry("IIS://" + "localhost"
    + mRootSubPath,winAcctId,winAcctPwd,AuthenticationTy pes.Secure);

    ....

    if (Directory.Exists("c:\temp\Eskimo\") == false)
    {

    Directory.CreateDirectory("c:\temp\Eskimo\");

    }

    deRoot.RefreshCache();

    DirectoryEntry deNewVDir =
    deRoot.Children.Add("Eskimo",mSchema);

    deNewVDir.Properties["Path"].Insert(0,"c:\temp\Eskimo\");

    ....
    deNewVDir.Properties["AccessRead"][0] =true;
    deNewVDir.Properties["AccessWrite"][0] = true;
    deNewVDir.Properties["Accesecute"][0] = true;
    deNewVDir.Properties["AuthAnonymous"][0] = false;
    deNewVDir.Properties["AuthBasic"][0] = false;
    deNewVDir.Properties["AuthNTLM"][0] = true;
    deNewVDir.Properties["ContentIndexed"][0] = false;
    deNewVDir.Properties["EnableDirBrowsing"][0] = true;
    ...
    deNewVDir.Invoke("AppCreate",true);

    deNewVDir.CommitChanges();
    deRoot.CommitChanges();

    deNewVDir.Close();

    deRoot.Close();
    ....

    Now: in a windows application it works great! I have a DLL project and a
    windows app test project and the web service accessing the DLL project.
    In a web service I get the error listed above... :(

    --
    tym, Eskimo
    Eskimo Guest

  2. #2

    Default Re: IIS Virtual Directory Create Failure in Web Service :(

    You get the error because a WindowsApplication runs under the CodeGroup
    My_Computer_Zone, WebServices and WebApplications run under
    LocalIntranet_Zone. It's a CodeAccessSecurity issue.

    Try to add an assembly with the code to the GAC, write a wrapper for the GAC
    assembly and deploy it to the bin directory of the WebService and call the
    methods of the wrapper from the assembly of your solution (WebService).

    --
    Daniel Fisher(lennybacon)
    MCP ASP.NET C#
    Blog: [url]http://www.lennybacon.com/[/url]


    "Eskimo" <Eskimodiscussions.microsoft.com> wrote in message
    news:A6D68D60-6B23-414D-B4C2-6798FFD0C76Bmicrosoft.com...
    >
    > System.UnauthorizedAccesception: Access is denied.
    > at System.DirectoryServices.Interop.IAds.SetInfo()
    > at System.DirectoryServices.DirectoryEntry.CommitChan ges()
    > at CreateVirtualDirectories.Dal.CreateWebVirtualDirec tory.Create
    >
    > ...
    >
    > tried on the local development box and it had issues like this
    >
    > until I gave permissions like described in Article ID 329986, scroll down,
    > Method A.
    >
    > It is a double hop as I did the test at the bottom in the Quick Test
    > section.
    >
    >
    >
    > Code snippets:
    >
    > Web.config for web service having the error shown above...
    >
    > <identity impersonate="true" />
    > ...
    >
    > SCHEMA= "IIsWebVirtualDir";
    > mRootSubPath = "/W3SVC/1/Root";
    >
    > ...
    >
    > DirectoryEntry deRoot= new DirectoryEntry("IIS://" +
    > "localhost"
    > + mRootSubPath,winAcctId,winAcctPwd,AuthenticationTy pes.Secure);
    >
    > ...
    >
    > if (Directory.Exists("c:\temp\Eskimo\") == false)
    > {
    >
    > Directory.CreateDirectory("c:\temp\Eskimo\");
    >
    > }
    >
    > deRoot.RefreshCache();
    >
    > DirectoryEntry deNewVDir =
    > deRoot.Children.Add("Eskimo",mSchema);
    >
    > deNewVDir.Properties["Path"].Insert(0,"c:\temp\Eskimo\");
    >
    > ...
    > deNewVDir.Properties["AccessRead"][0] =true;
    > deNewVDir.Properties["AccessWrite"][0] = true;
    > deNewVDir.Properties["Accesecute"][0] = true;
    > deNewVDir.Properties["AuthAnonymous"][0] = false;
    > deNewVDir.Properties["AuthBasic"][0] = false;
    > deNewVDir.Properties["AuthNTLM"][0] = true;
    > deNewVDir.Properties["ContentIndexed"][0] = false;
    > deNewVDir.Properties["EnableDirBrowsing"][0] = true;
    > ...
    > deNewVDir.Invoke("AppCreate",true);
    >
    > deNewVDir.CommitChanges();
    > deRoot.CommitChanges();
    >
    > deNewVDir.Close();
    >
    > deRoot.Close();
    > ...
    >
    > Now: in a windows application it works great! I have a DLL project and a
    > windows app test project and the web service accessing the DLL project.
    > In a web service I get the error listed above... :(
    >
    > --
    > tym, Eskimo

    Daniel Fisher\(lennybacon\) Guest

  3. #3

    Default Re: IIS Virtual Directory Create Failure in Web Service :(

    ?????

    It's installed on a win 2003 server with a web installation project. It
    works fine on the dev box, not on the server <grrr - code fix? />

    as such - it's in the gac! the dll project is just that - a dll referenced
    via the web service. the windows app hits the same dll project.

    code example please of the "hello world" web service for what you're
    suggesting :)

    "Daniel Fisher(lennybacon)" wrote:
    > You get the error because a WindowsApplication runs under the CodeGroup
    > My_Computer_Zone, WebServices and WebApplications run under
    > LocalIntranet_Zone. It's a CodeAccessSecurity issue.
    >
    > Try to add an assembly with the code to the GAC, write a wrapper for the GAC
    > assembly and deploy it to the bin directory of the WebService and call the
    > methods of the wrapper from the assembly of your solution (WebService).
    >
    > --
    > Daniel Fisher(lennybacon)
    > MCP ASP.NET C#
    > Blog: [url]http://www.lennybacon.com/[/url]
    >
    >
    > "Eskimo" <Eskimodiscussions.microsoft.com> wrote in message
    > news:A6D68D60-6B23-414D-B4C2-6798FFD0C76Bmicrosoft.com...
    > >
    > > System.UnauthorizedAccesception: Access is denied.
    > > at System.DirectoryServices.Interop.IAds.SetInfo()
    > > at System.DirectoryServices.DirectoryEntry.CommitChan ges()
    > > at CreateVirtualDirectories.Dal.CreateWebVirtualDirec tory.Create
    > >
    > > ...
    > >
    > > tried on the local development box and it had issues like this
    > >
    > > until I gave permissions like described in Article ID 329986, scroll down,
    > > Method A.
    > >
    > > It is a double hop as I did the test at the bottom in the Quick Test
    > > section.
    > >
    > >
    > >
    > > Code snippets:
    > >
    > > Web.config for web service having the error shown above...
    > >
    > > <identity impersonate="true" />
    > > ...
    > >
    > > SCHEMA= "IIsWebVirtualDir";
    > > mRootSubPath = "/W3SVC/1/Root";
    > >
    > > ...
    > >
    > > DirectoryEntry deRoot= new DirectoryEntry("IIS://" +
    > > "localhost"
    > > + mRootSubPath,winAcctId,winAcctPwd,AuthenticationTy pes.Secure);
    > >
    > > ...
    > >
    > > if (Directory.Exists("c:\temp\Eskimo\") == false)
    > > {
    > >
    > > Directory.CreateDirectory("c:\temp\Eskimo\");
    > >
    > > }
    > >
    > > deRoot.RefreshCache();
    > >
    > > DirectoryEntry deNewVDir =
    > > deRoot.Children.Add("Eskimo",mSchema);
    > >
    > > deNewVDir.Properties["Path"].Insert(0,"c:\temp\Eskimo\");
    > >
    > > ...
    > > deNewVDir.Properties["AccessRead"][0] =true;
    > > deNewVDir.Properties["AccessWrite"][0] = true;
    > > deNewVDir.Properties["Accesecute"][0] = true;
    > > deNewVDir.Properties["AuthAnonymous"][0] = false;
    > > deNewVDir.Properties["AuthBasic"][0] = false;
    > > deNewVDir.Properties["AuthNTLM"][0] = true;
    > > deNewVDir.Properties["ContentIndexed"][0] = false;
    > > deNewVDir.Properties["EnableDirBrowsing"][0] = true;
    > > ...
    > > deNewVDir.Invoke("AppCreate",true);
    > >
    > > deNewVDir.CommitChanges();
    > > deRoot.CommitChanges();
    > >
    > > deNewVDir.Close();
    > >
    > > deRoot.Close();
    > > ...
    > >
    > > Now: in a windows application it works great! I have a DLL project and a
    > > windows app test project and the web service accessing the DLL project.
    > > In a web service I get the error listed above... :(
    > >
    > > --
    > > tym, Eskimo
    >
    >
    >
    Eskimo Guest

  4. #4

    Default Re: IIS Virtual Directory Create Failure in Web Service :(

    Actually, it would have been a SecurityException if it was related to CAS.
    This was the Windows security error that we were previously discussing.
    Also, it is more typical for web applications to run with Full Trust.
    Downloaded controls tend to run in partial trust, but that wasn't being
    discussed here.

    Joe K.

    "Eskimo" <Eskimodiscussions.microsoft.com> wrote in message
    news:2E7CA37B-3AE3-4E9B-BBDB-D719115EE0F8microsoft.com...
    > ?????
    >
    > It's installed on a win 2003 server with a web installation project. It
    > works fine on the dev box, not on the server <grrr - code fix? />
    >
    > as such - it's in the gac! the dll project is just that - a dll
    > referenced
    > via the web service. the windows app hits the same dll project.
    >
    > code example please of the "hello world" web service for what you're
    > suggesting :)
    >
    > "Daniel Fisher(lennybacon)" wrote:
    >
    >> You get the error because a WindowsApplication runs under the CodeGroup
    >> My_Computer_Zone, WebServices and WebApplications run under
    >> LocalIntranet_Zone. It's a CodeAccessSecurity issue.
    >>
    >> Try to add an assembly with the code to the GAC, write a wrapper for the
    >> GAC
    >> assembly and deploy it to the bin directory of the WebService and call
    >> the
    >> methods of the wrapper from the assembly of your solution (WebService).
    >>
    >> --
    >> Daniel Fisher(lennybacon)
    >> MCP ASP.NET C#
    >> Blog: [url]http://www.lennybacon.com/[/url]
    >>
    >>
    >> "Eskimo" <Eskimodiscussions.microsoft.com> wrote in message
    >> news:A6D68D60-6B23-414D-B4C2-6798FFD0C76Bmicrosoft.com...
    >> >
    >> > System.UnauthorizedAccesception: Access is denied.
    >> > at System.DirectoryServices.Interop.IAds.SetInfo()
    >> > at System.DirectoryServices.DirectoryEntry.CommitChan ges()
    >> > at CreateVirtualDirectories.Dal.CreateWebVirtualDirec tory.Create
    >> >
    >> > ...
    >> >
    >> > tried on the local development box and it had issues like this
    >> >
    >> > until I gave permissions like described in Article ID 329986, scroll
    >> > down,
    >> > Method A.
    >> >
    >> > It is a double hop as I did the test at the bottom in the Quick Test
    >> > section.
    >> >
    >> >
    >> >
    >> > Code snippets:
    >> >
    >> > Web.config for web service having the error shown above...
    >> >
    >> > <identity impersonate="true" />
    >> > ...
    >> >
    >> > SCHEMA= "IIsWebVirtualDir";
    >> > mRootSubPath = "/W3SVC/1/Root";
    >> >
    >> > ...
    >> >
    >> > DirectoryEntry deRoot= new DirectoryEntry("IIS://" +
    >> > "localhost"
    >> > + mRootSubPath,winAcctId,winAcctPwd,AuthenticationTy pes.Secure);
    >> >
    >> > ...
    >> >
    >> > if (Directory.Exists("c:\temp\Eskimo\") == false)
    >> > {
    >> >
    >> > Directory.CreateDirectory("c:\temp\Eskimo\");
    >> >
    >> > }
    >> >
    >> > deRoot.RefreshCache();
    >> >
    >> > DirectoryEntry deNewVDir =
    >> > deRoot.Children.Add("Eskimo",mSchema);
    >> >
    >> >
    >> > deNewVDir.Properties["Path"].Insert(0,"c:\temp\Eskimo\");
    >> >
    >> > ...
    >> > deNewVDir.Properties["AccessRead"][0] =true;
    >> > deNewVDir.Properties["AccessWrite"][0] = true;
    >> > deNewVDir.Properties["Accesecute"][0] = true;
    >> > deNewVDir.Properties["AuthAnonymous"][0] = false;
    >> > deNewVDir.Properties["AuthBasic"][0] = false;
    >> > deNewVDir.Properties["AuthNTLM"][0] = true;
    >> > deNewVDir.Properties["ContentIndexed"][0] = false;
    >> > deNewVDir.Properties["EnableDirBrowsing"][0] = true;
    >> > ...
    >> > deNewVDir.Invoke("AppCreate",true);
    >> >
    >> > deNewVDir.CommitChanges();
    >> > deRoot.CommitChanges();
    >> >
    >> > deNewVDir.Close();
    >> >
    >> > deRoot.Close();
    >> > ...
    >> >
    >> > Now: in a windows application it works great! I have a DLL project and
    >> > a
    >> > windows app test project and the web service accessing the DLL project.
    >> > In a web service I get the error listed above... :(
    >> >
    >> > --
    >> > tym, Eskimo
    >>
    >>
    >>

    Joe Kaplan \(MVP - ADSI\) Guest

  5. #5

    Default Re: IIS Virtual Directory Create Failure in Web Service :(

    So where do you assign a web service full trust? and the underlying dll's ?



    "Joe Kaplan (MVP - ADSI)" wrote:
    > Actually, it would have been a SecurityException if it was related to CAS.
    > This was the Windows security error that we were previously discussing.
    > Also, it is more typical for web applications to run with Full Trust.
    > Downloaded controls tend to run in partial trust, but that wasn't being
    > discussed here.
    >
    > Joe K.
    >
    > "Eskimo" <Eskimodiscussions.microsoft.com> wrote in message
    > news:2E7CA37B-3AE3-4E9B-BBDB-D719115EE0F8microsoft.com...
    > > ?????
    > >
    > > It's installed on a win 2003 server with a web installation project. It
    > > works fine on the dev box, not on the server <grrr - code fix? />
    > >
    > > as such - it's in the gac! the dll project is just that - a dll
    > > referenced
    > > via the web service. the windows app hits the same dll project.
    > >
    > > code example please of the "hello world" web service for what you're
    > > suggesting :)
    > >
    > > "Daniel Fisher(lennybacon)" wrote:
    > >
    > >> You get the error because a WindowsApplication runs under the CodeGroup
    > >> My_Computer_Zone, WebServices and WebApplications run under
    > >> LocalIntranet_Zone. It's a CodeAccessSecurity issue.
    > >>
    > >> Try to add an assembly with the code to the GAC, write a wrapper for the
    > >> GAC
    > >> assembly and deploy it to the bin directory of the WebService and call
    > >> the
    > >> methods of the wrapper from the assembly of your solution (WebService).
    > >>
    > >> --
    > >> Daniel Fisher(lennybacon)
    > >> MCP ASP.NET C#
    > >> Blog: [url]http://www.lennybacon.com/[/url]
    > >>
    > >>
    > >> "Eskimo" <Eskimodiscussions.microsoft.com> wrote in message
    > >> news:A6D68D60-6B23-414D-B4C2-6798FFD0C76Bmicrosoft.com...
    > >> >
    > >> > System.UnauthorizedAccesception: Access is denied.
    > >> > at System.DirectoryServices.Interop.IAds.SetInfo()
    > >> > at System.DirectoryServices.DirectoryEntry.CommitChan ges()
    > >> > at CreateVirtualDirectories.Dal.CreateWebVirtualDirec tory.Create
    > >> >
    > >> > ...
    > >> >
    > >> > tried on the local development box and it had issues like this
    > >> >
    > >> > until I gave permissions like described in Article ID 329986, scroll
    > >> > down,
    > >> > Method A.
    > >> >
    > >> > It is a double hop as I did the test at the bottom in the Quick Test
    > >> > section.
    > >> >
    > >> >
    > >> >
    > >> > Code snippets:
    > >> >
    > >> > Web.config for web service having the error shown above...
    > >> >
    > >> > <identity impersonate="true" />
    > >> > ...
    > >> >
    > >> > SCHEMA= "IIsWebVirtualDir";
    > >> > mRootSubPath = "/W3SVC/1/Root";
    > >> >
    > >> > ...
    > >> >
    > >> > DirectoryEntry deRoot= new DirectoryEntry("IIS://" +
    > >> > "localhost"
    > >> > + mRootSubPath,winAcctId,winAcctPwd,AuthenticationTy pes.Secure);
    > >> >
    > >> > ...
    > >> >
    > >> > if (Directory.Exists("c:\temp\Eskimo\") == false)
    > >> > {
    > >> >
    > >> > Directory.CreateDirectory("c:\temp\Eskimo\");
    > >> >
    > >> > }
    > >> >
    > >> > deRoot.RefreshCache();
    > >> >
    > >> > DirectoryEntry deNewVDir =
    > >> > deRoot.Children.Add("Eskimo",mSchema);
    > >> >
    > >> >
    > >> > deNewVDir.Properties["Path"].Insert(0,"c:\temp\Eskimo\");
    > >> >
    > >> > ...
    > >> > deNewVDir.Properties["AccessRead"][0] =true;
    > >> > deNewVDir.Properties["AccessWrite"][0] = true;
    > >> > deNewVDir.Properties["Accesecute"][0] = true;
    > >> > deNewVDir.Properties["AuthAnonymous"][0] = false;
    > >> > deNewVDir.Properties["AuthBasic"][0] = false;
    > >> > deNewVDir.Properties["AuthNTLM"][0] = true;
    > >> > deNewVDir.Properties["ContentIndexed"][0] = false;
    > >> > deNewVDir.Properties["EnableDirBrowsing"][0] = true;
    > >> > ...
    > >> > deNewVDir.Invoke("AppCreate",true);
    > >> >
    > >> > deNewVDir.CommitChanges();
    > >> > deRoot.CommitChanges();
    > >> >
    > >> > deNewVDir.Close();
    > >> >
    > >> > deRoot.Close();
    > >> > ...
    > >> >
    > >> > Now: in a windows application it works great! I have a DLL project and
    > >> > a
    > >> > windows app test project and the web service accessing the DLL project.
    > >> > In a web service I get the error listed above... :(
    > >> >
    > >> > --
    > >> > tym, Eskimo
    > >>
    > >>
    > >>
    >
    >
    >
    Eskimo Guest

  6. #6

    Default Re: IIS Virtual Directory Create Failure in Web Service :(

    In your case, you already have Full Trust. You can't even call
    System.DirectoryServices.dll without it because it doesn't allow partially
    trusted callers at all. So that isn't really important for the original
    issue you were asking about. That is strictly an issue with Windows
    security.

    However, to modify CAS policy for a web application, you modify the
    <securityPolicy> element in web.config.

    Joe K.

    "Eskimo" <Eskimodiscussions.microsoft.com> wrote in message
    news:FE26B6EE-BC1E-4FCB-BF86-BE87BF38FF59microsoft.com...
    > So where do you assign a web service full trust? and the underlying dll's
    > ?
    >
    >
    >
    > "Joe Kaplan (MVP - ADSI)" wrote:
    >
    >> Actually, it would have been a SecurityException if it was related to
    >> CAS.
    >> This was the Windows security error that we were previously discussing.
    >> Also, it is more typical for web applications to run with Full Trust.
    >> Downloaded controls tend to run in partial trust, but that wasn't being
    >> discussed here.
    >>
    >> Joe K.
    >>
    >> "Eskimo" <Eskimodiscussions.microsoft.com> wrote in message
    >> news:2E7CA37B-3AE3-4E9B-BBDB-D719115EE0F8microsoft.com...
    >> > ?????
    >> >
    >> > It's installed on a win 2003 server with a web installation project.
    >> > It
    >> > works fine on the dev box, not on the server <grrr - code fix? />
    >> >
    >> > as such - it's in the gac! the dll project is just that - a dll
    >> > referenced
    >> > via the web service. the windows app hits the same dll project.
    >> >
    >> > code example please of the "hello world" web service for what you're
    >> > suggesting :)
    >> >
    >> > "Daniel Fisher(lennybacon)" wrote:
    >> >
    >> >> You get the error because a WindowsApplication runs under the
    >> >> CodeGroup
    >> >> My_Computer_Zone, WebServices and WebApplications run under
    >> >> LocalIntranet_Zone. It's a CodeAccessSecurity issue.
    >> >>
    >> >> Try to add an assembly with the code to the GAC, write a wrapper for
    >> >> the
    >> >> GAC
    >> >> assembly and deploy it to the bin directory of the WebService and call
    >> >> the
    >> >> methods of the wrapper from the assembly of your solution
    >> >> (WebService).
    >> >>
    >> >> --
    >> >> Daniel Fisher(lennybacon)
    >> >> MCP ASP.NET C#
    >> >> Blog: [url]http://www.lennybacon.com/[/url]
    >> >>
    >> >>
    >> >> "Eskimo" <Eskimodiscussions.microsoft.com> wrote in message
    >> >> news:A6D68D60-6B23-414D-B4C2-6798FFD0C76Bmicrosoft.com...
    >> >> >
    >> >> > System.UnauthorizedAccesception: Access is denied.
    >> >> > at System.DirectoryServices.Interop.IAds.SetInfo()
    >> >> > at System.DirectoryServices.DirectoryEntry.CommitChan ges()
    >> >> > at CreateVirtualDirectories.Dal.CreateWebVirtualDirec tory.Create
    >> >> >
    >> >> > ...
    >> >> >
    >> >> > tried on the local development box and it had issues like this
    >> >> >
    >> >> > until I gave permissions like described in Article ID 329986, scroll
    >> >> > down,
    >> >> > Method A.
    >> >> >
    >> >> > It is a double hop as I did the test at the bottom in the Quick Test
    >> >> > section.
    >> >> >
    >> >> >
    >> >> >
    >> >> > Code snippets:
    >> >> >
    >> >> > Web.config for web service having the error shown above...
    >> >> >
    >> >> > <identity impersonate="true" />
    >> >> > ...
    >> >> >
    >> >> > SCHEMA= "IIsWebVirtualDir";
    >> >> > mRootSubPath = "/W3SVC/1/Root";
    >> >> >
    >> >> > ...
    >> >> >
    >> >> > DirectoryEntry deRoot= new DirectoryEntry("IIS://" +
    >> >> > "localhost"
    >> >> > + mRootSubPath,winAcctId,winAcctPwd,AuthenticationTy pes.Secure);
    >> >> >
    >> >> > ...
    >> >> >
    >> >> > if (Directory.Exists("c:\temp\Eskimo\") == false)
    >> >> > {
    >> >> >
    >> >> > Directory.CreateDirectory("c:\temp\Eskimo\");
    >> >> >
    >> >> > }
    >> >> >
    >> >> > deRoot.RefreshCache();
    >> >> >
    >> >> > DirectoryEntry deNewVDir =
    >> >> > deRoot.Children.Add("Eskimo",mSchema);
    >> >> >
    >> >> >
    >> >> > deNewVDir.Properties["Path"].Insert(0,"c:\temp\Eskimo\");
    >> >> >
    >> >> > ...
    >> >> > deNewVDir.Properties["AccessRead"][0] =true;
    >> >> > deNewVDir.Properties["AccessWrite"][0] = true;
    >> >> > deNewVDir.Properties["Accesecute"][0] = true;
    >> >> > deNewVDir.Properties["AuthAnonymous"][0] = false;
    >> >> > deNewVDir.Properties["AuthBasic"][0] = false;
    >> >> > deNewVDir.Properties["AuthNTLM"][0] = true;
    >> >> > deNewVDir.Properties["ContentIndexed"][0] = false;
    >> >> > deNewVDir.Properties["EnableDirBrowsing"][0] = true;
    >> >> > ...
    >> >> > deNewVDir.Invoke("AppCreate",true);
    >> >> >
    >> >> > deNewVDir.CommitChanges();
    >> >> > deRoot.CommitChanges();
    >> >> >
    >> >> > deNewVDir.Close();
    >> >> >
    >> >> > deRoot.Close();
    >> >> > ...
    >> >> >
    >> >> > Now: in a windows application it works great! I have a DLL project
    >> >> > and
    >> >> > a
    >> >> > windows app test project and the web service accessing the DLL
    >> >> > project.
    >> >> > In a web service I get the error listed above... :(
    >> >> >
    >> >> > --
    >> >> > tym, Eskimo
    >> >>
    >> >>
    >> >>
    >>
    >>
    >>

    Joe Kaplan \(MVP - ADSI\) Guest

Similar Threads

  1. IIS Virtual Directory Create Failure :(
    By Eskimo in forum ASP.NET Web Services
    Replies: 4
    Last Post: November 22nd, 04:57 PM
  2. Replies: 6
    Last Post: October 18th, 09:42 AM
  3. can't create directory from web service
    By Marc Pensa in forum ASP.NET Web Services
    Replies: 6
    Last Post: September 11th, 12:08 PM
  4. Create file in virtual directory
    By Glenn in forum ASP
    Replies: 6
    Last Post: August 27th, 10:25 PM
  5. How to create a new Virtual Directory?
    By qiuji in forum ASP.NET General
    Replies: 0
    Last Post: August 12th, 07:02 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139