Quantcast
Channel: WCF, ASMX and other Web Services
Viewing all articles
Browse latest Browse all 555

I have this exception when I will try running my site on the iis version 10 on the windows server

$
0
0
  //try
           // {
                foreach (DirectoryEntry site in w3svc.Children)
                {
                    if (site.Properties["ServerComment"] != null)
                    {
                        if (site.Properties["ServerComment"].Value != null)
                        {
                            site_name = site.Properties["ServerComment"].Value.ToString();


                            if (site_name.Equals(websiteName + app))

                            //     if (string.Compare(site.Properties["ServerComment"].Value.ToString(), websiteName, false) == 0)//origional condition
                            {
                                result = true;
                                IisWebSite iss = new IisWebSite();
                                iss.BINDING = site.Properties["ServerBindings"].Value.ToString();
                                iss.NAME = site.Properties["ServerComment"].Value.ToString();
                                sitelist.Add(iss);
                                // re = site.Properties["ServerComment"].Value.ToString();
                            }
                        }
                     }
                }

my error is that

System.Runtime.InteropServices.COMException: Access is denied.

   at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
   at System.DirectoryServices.DirectoryEntry.Bind()
   at System.DirectoryServices.DirectoryEntry.get_IsContainer()
   at System.DirectoryServices.DirectoryEntries.ChildEnumerator..ctor(DirectoryEntry container)
   at Public_url_service.WebService1.EnterCompanyName(String websiteName, String app) in 


Viewing all articles
Browse latest Browse all 555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>