HELP! IIS create virtual directory works great in winapp, !webserv
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS Server Security > HELP! IIS create virtual directory works great in winapp, !webserv




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    HELP! IIS create virtual directory works great in winapp, !webserv  
Eskimo


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-05-04 10:50 PM


System.UnauthorizedAccessException: Access is denied.
at System.DirectoryServices.Interop.IAds.SetInfo()
at System.DirectoryServices.DirectoryEntry.CommitChanges()
at CreateVirtualDirectories.Dal.CreateWebVirtualDirectory.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,Authen
ticationTypes.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["AccessExecute"][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





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:36 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register