public void DeleteVirtualRootEx(string rootWebServer, string inBaseUrl, string inVirtualRoot)
 {
     try
     {
         try
         {
             new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand();
         }
         catch (SecurityException)
         {
             ComSoapPublishError.Report(Resource.FormatString("Soap_SecurityFailure"));
             throw;
         }
         if ((inBaseUrl.Length > 0) || (inVirtualRoot.Length > 0))
         {
             int    length      = rootWebServer.Length;
             string inProtocol  = "";
             string baseUrl     = "";
             string virtualRoot = "";
             SoapServerInfo.ParseUrl(inBaseUrl, inVirtualRoot, inProtocol, out baseUrl, out virtualRoot);
         }
     }
     catch (Exception exception)
     {
         if ((exception is NullReferenceException) || (exception is SEHException))
         {
             throw;
         }
         ComSoapPublishError.Report(Resource.FormatString("Soap_VRootDirectoryDeletionFailed"));
         throw;
     }
 }
        public void DeleteServerTlb(string progId, string classId, string interfaceId, string srcTlbPath, string rootWebServer, string baseUrl, string virtualRoot, string operation, string assemblyName, string typeName)
        {
            try
            {
                new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand();
            }
            catch (SecurityException)
            {
                ComSoapPublishError.Report(Resource.FormatString("Soap_SecurityFailure"));
                throw;
            }
            string name = assemblyName;

            if ((((progId.Length > 0) || (classId.Length > 0)) || ((assemblyName.Length > 0) || (typeName.Length > 0))) && ((baseUrl.Length > 0) || (virtualRoot.Length > 0)))
            {
                string str3 = SoapServerInfo.ServerPhysicalPath(rootWebServer, baseUrl, virtualRoot, false);
                string str4 = srcTlbPath.ToLower(CultureInfo.InvariantCulture);
                if (!str4.EndsWith("scrobj.dll", StringComparison.Ordinal))
                {
                    if (str4.EndsWith("mscoree.dll", StringComparison.Ordinal))
                    {
                        Type typeFromProgID = Type.GetTypeFromProgID(progId);
                        typeName = typeFromProgID.FullName;
                        name     = typeFromProgID.Assembly.GetName().Name;
                    }
                    else
                    {
                        name = new GenerateMetadata().GetAssemblyName(srcTlbPath, str3 + @"\bin\");
                        if (name.Length > 0)
                        {
                            try
                            {
                                typeName = this.GetTypeName(str3 + @"\bin\" + name + ".dll", progId, classId);
                            }
                            catch (DirectoryNotFoundException)
                            {
                            }
                            catch (FileNotFoundException)
                            {
                            }
                        }
                    }
                    if ((!string.IsNullOrEmpty(progId) && !string.IsNullOrEmpty(name)) && !string.IsNullOrEmpty(typeName))
                    {
                        DiscoFile file         = new DiscoFile();
                        string    assemblyFile = str3 + @"\bin\" + name + ".dll";
                        SoapServerConfig.DeleteComponent(str3 + @"\Web.Config", name, typeName, progId, assemblyFile);
                        file.DeleteElement(str3 + @"\Default.disco", progId + ".soap?WSDL");
                    }
                }
            }
        }
 public void GetServerPhysicalPath(string rootWebServer, string inBaseUrl, string inVirtualRoot, out string physicalPath)
 {
     try
     {
         new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand();
         physicalPath = SoapServerInfo.ServerPhysicalPath(rootWebServer, inBaseUrl, inVirtualRoot, false);
     }
     catch (SecurityException)
     {
         ComSoapPublishError.Report(Resource.FormatString("Soap_SecurityFailure"));
         throw;
     }
 }
        public void GetVirtualRootStatus(string RootWebServer, string inBaseUrl, string inVirtualRoot, out string Exists, out string SSL, out string WindowsAuth, out string Anonymous, out string HomePage, out string DiscoFile, out string PhysicalPath, out string BaseUrl, out string VirtualRoot)
        {
            string rootWebServer = "IIS://localhost/W3SVC/1/ROOT";

            if (RootWebServer.Length > 0)
            {
                rootWebServer = RootWebServer;
            }
            Exists      = "false";
            SSL         = "false";
            WindowsAuth = "false";
            Anonymous   = "false";
            HomePage    = "false";
            DiscoFile   = "false";
            SoapServerInfo.ParseUrl(inBaseUrl, inVirtualRoot, "http", out BaseUrl, out VirtualRoot);
            PhysicalPath = SoapServerInfo.ServerPhysicalPath(rootWebServer, BaseUrl, VirtualRoot, false);
            bool bExists      = false;
            bool bSSL         = false;
            bool bWindowsAuth = false;
            bool bAnonymous   = false;
            bool bHomePage    = false;
            bool bDiscoFile   = false;

            IISVirtualRootEx.GetStatus(rootWebServer, PhysicalPath, VirtualRoot, out bExists, out bSSL, out bWindowsAuth, out bAnonymous, out bHomePage, out bDiscoFile);
            if (bExists)
            {
                Exists = "true";
            }
            if (bSSL)
            {
                SSL = "true";
                SoapServerInfo.ParseUrl(inBaseUrl, inVirtualRoot, "https", out BaseUrl, out VirtualRoot);
            }
            if (bWindowsAuth)
            {
                WindowsAuth = "true";
            }
            if (bAnonymous)
            {
                Anonymous = "true";
            }
            if (bHomePage)
            {
                HomePage = "true";
            }
            if (bDiscoFile)
            {
                DiscoFile = "true";
            }
        }
Ejemplo n.º 5
0
        /// <include file='doc\SoapServerVroot.uex' path='docs/doc[@for="SoapServerVRoot.DeleteVirtualRootEx"]/*' />
        public void DeleteVirtualRootEx(
            string rootWebServer,
            string inBaseUrl,
            string inVirtualRoot
            )
        {
            try
            {
                // set default root web server if the caller has not
                try
                {
                    SecurityPermission sp = new SecurityPermission(SecurityPermissionFlag.UnmanagedCode);
                    sp.Demand();
                }
                catch (Exception e)
                {
                    if (e.GetType() == typeof(System.Security.SecurityException))
                    {
                        string Error = Resource.FormatString("Soap_SecurityFailure");
                        ComSoapPublishError.Report(Error);
                    }
                    throw;
                }

                Platform.Assert(Platform.Whistler, "SoapServerVRoot.DeleteVirtualRootEx");
                if (inBaseUrl.Length <= 0 && inVirtualRoot.Length <= 0)
                {
                    return;
                }
                string rootWeb = "IIS://localhost/W3SVC/1/ROOT";
                if (rootWebServer.Length > 0)
                {
                    rootWeb = rootWebServer;
                }
                string Protocol    = ""; //doesn't matter in delete case
                string BaseUrl     = "";
                string VirtualRoot = "";
                SoapServerInfo.ParseUrl(inBaseUrl, inVirtualRoot, Protocol, out BaseUrl, out VirtualRoot);
                // to preserve RTM behavior, the following line is commented out
                // to actually remove a vroot, uncomment the following line
                //IISVirtualRootEx.Delete(rootWeb, VirtualRoot);
            }
            catch
            {
                string Error = Resource.FormatString("Soap_VRootDirectoryDeletionFailed");
                ComSoapPublishError.Report(Error);
                throw;
            }
        }
Ejemplo n.º 6
0
 /// <include file='doc\SoapServerInfo.uex' path='docs/doc[@for="SoapUtility.GetServerBinPath"]/*' />
 public void GetServerBinPath(
     string rootWebServer,
     string inBaseUrl,
     string inVirtualRoot,
     out string binPath
     )
 {
     try
     {
         SecurityPermission sp = new SecurityPermission(SecurityPermissionFlag.UnmanagedCode);
         sp.Demand();
         Platform.Assert(Platform.Whistler, "SoapUtility.GetServerBinPath");
         binPath = SoapServerInfo.ServerPhysicalPath(rootWebServer, inBaseUrl, inVirtualRoot, false) + "\\bin\\";
     }
     catch (Exception e)
     {
         if (e.GetType() == typeof(System.Security.SecurityException))
         {
             string Error = Resource.FormatString("Soap_SecurityFailure");
             ComSoapPublishError.Report(Error);
         }
         throw;
     }
 }
        public void CreateVirtualRootEx(string rootWebServer, string inBaseUrl, string inVirtualRoot, string homePage, string discoFile, string secureSockets, string authentication, string operation, out string baseUrl, out string virtualRoot, out string physicalPath)
        {
            baseUrl      = "";
            virtualRoot  = "";
            physicalPath = "";
            bool inDefault   = true;
            bool windowsAuth = true;
            bool anonymous   = false;
            bool flag4       = false;
            bool flag5       = false;
            bool impersonate = true;

            try
            {
                new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand();
                if ((inBaseUrl.Length > 0) || (inVirtualRoot.Length > 0))
                {
                    string str = "IIS://localhost/W3SVC/1/ROOT";
                    if (rootWebServer.Length > 0)
                    {
                        str = rootWebServer;
                    }
                    if (authentication.ToLower(CultureInfo.InvariantCulture) == "anonymous")
                    {
                        anonymous   = true;
                        windowsAuth = false;
                        impersonate = false;
                    }
                    flag4     = SoapServerInfo.BoolFromString(discoFile, flag4);
                    flag5     = SoapServerInfo.BoolFromString(homePage, flag5);
                    inDefault = SoapServerInfo.BoolFromString(secureSockets, inDefault);
                    string inProtocol = "https";
                    if (!inDefault)
                    {
                        inProtocol = "http";
                    }
                    SoapServerInfo.CheckUrl(inBaseUrl, inVirtualRoot, inProtocol);
                    SoapServerInfo.ParseUrl(inBaseUrl, inVirtualRoot, inProtocol, out baseUrl, out virtualRoot);
                    physicalPath = SoapServerInfo.ServerPhysicalPath(str, inBaseUrl, inVirtualRoot, true);
                    SoapServerConfig.Create(physicalPath, impersonate, windowsAuth);
                    if (flag4)
                    {
                        new DiscoFile().Create(physicalPath, "Default.disco");
                    }
                    else if (File.Exists(physicalPath + @"\Default.disco"))
                    {
                        File.Delete(physicalPath + @"\Default.disco");
                    }
                    if (flag5)
                    {
                        HomePage page     = new HomePage();
                        string   discoRef = "";
                        if (flag4)
                        {
                            discoRef = "Default.disco";
                        }
                        page.Create(physicalPath, virtualRoot, "Default.aspx", discoRef);
                    }
                    else if (File.Exists(physicalPath + @"\Default.aspx"))
                    {
                        File.Delete(physicalPath + @"\Default.aspx");
                    }
                    IISVirtualRootEx.CreateOrModify(str, physicalPath, virtualRoot, inDefault, windowsAuth, anonymous, flag5);
                }
            }
            catch (Exception exception)
            {
                if ((exception is NullReferenceException) || (exception is SEHException))
                {
                    throw;
                }
                ComSoapPublishError.Report(Resource.FormatString("Soap_VRootCreationFailed") + " " + virtualRoot);
                throw;
            }
        }
Ejemplo n.º 8
0
        /// <include file='doc\SoapServerVroot.uex' path='docs/doc[@for="SoapServerVRoot.CreateVirtualRootEx"]/*' />
        public void CreateVirtualRootEx(
            string rootWebServer,
            string inBaseUrl,
            string inVirtualRoot,
            string homePage,
            string discoFile,
            string secureSockets,
            string authentication,
            string operation,
            out string baseUrl,
            out string virtualRoot,
            out string physicalPath
            )
        {
            // if Operation if an empty string, the VRoot will be published
            baseUrl      = "";
            virtualRoot  = "";
            physicalPath = "";
            bool bSSL         = true;
            bool bWindowsAuth = true;
            bool bAnonymous   = false;
            bool bDiscoFile   = false;
            bool bHomePage    = false;
            bool bImpersonate = true;

            try
            {
                SecurityPermission sp = new SecurityPermission(SecurityPermissionFlag.UnmanagedCode);
                sp.Demand();
                Platform.Assert(Platform.Whistler, "SoapServerVRoot.CreateVirtualRootEx");
                if (inBaseUrl.Length <= 0 && inVirtualRoot.Length <= 0)
                {
                    return;
                }
                string rootWeb = "IIS://localhost/W3SVC/1/ROOT";
                if (rootWebServer.Length > 0)
                {
                    rootWeb = rootWebServer;
                }
                if (authentication.ToLower(CultureInfo.InvariantCulture) == "anonymous")
                {
                    bAnonymous   = true;
                    bWindowsAuth = false;
                    bImpersonate = false;
                }
                bDiscoFile = SoapServerInfo.BoolFromString(discoFile, bDiscoFile);
                bHomePage  = SoapServerInfo.BoolFromString(homePage, bHomePage);
                bSSL       = SoapServerInfo.BoolFromString(secureSockets, bSSL);
                string protocol = "https";
                if (!bSSL)
                {
                    protocol = "http";
                }
                SoapServerInfo.ParseUrl(inBaseUrl, inVirtualRoot, protocol, out baseUrl, out virtualRoot);
                physicalPath = SoapServerInfo.ServerPhysicalPath(rootWeb, inBaseUrl, inVirtualRoot, true);
                SoapServerConfig.Create(physicalPath, bImpersonate, bWindowsAuth);
                if (bDiscoFile)
                {
                    DiscoFile webDisco = new DiscoFile();
                    webDisco.Create(physicalPath, "Default.disco");
                }
                else
                {
                    if (File.Exists(physicalPath + "\\Default.disco"))
                    {
                        File.Delete(physicalPath + "\\Default.disco");
                    }
                }
                if (bHomePage)
                {
                    HomePage webPage       = new HomePage();
                    string   discoFileName = "";
                    if (bDiscoFile)
                    {
                        discoFileName = "Default.disco";
                    }
                    webPage.Create(physicalPath, virtualRoot, "Default.aspx", discoFileName);
                }
                else
                {
                    if (File.Exists(physicalPath + "\\Default.aspx"))
                    {
                        File.Delete(physicalPath + "\\Default.aspx");
                    }
                }
                IISVirtualRootEx.CreateOrModify(rootWeb, physicalPath, virtualRoot, bSSL, bWindowsAuth, bAnonymous, bHomePage);
            }
            catch
            {
                string etxt = Resource.FormatString("Soap_VRootCreationFailed");
                ComSoapPublishError.Report(etxt + " " + virtualRoot);
                throw;
            }
        }
        public void AddServerTlb(string progId, string classId, string interfaceId, string srcTlbPath, string rootWebServer, string inBaseUrl, string inVirtualRoot, string clientActivated, string wellKnown, string discoFile, string operation, out string strAssemblyName, out string typeName)
        {
            string name = string.Empty;

            strAssemblyName = string.Empty;
            typeName        = string.Empty;
            bool flag      = false;
            bool inDefault = false;
            bool flag3     = false;
            bool flag4     = true;

            try
            {
                try
                {
                    new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand();
                }
                catch (SecurityException)
                {
                    ComSoapPublishError.Report(Resource.FormatString("Soap_SecurityFailure"));
                    throw;
                }
                if ((operation != null) && (operation.ToLower(CultureInfo.InvariantCulture) == "delete"))
                {
                    flag = true;
                }
                if (srcTlbPath.Length > 0)
                {
                    inDefault = SoapServerInfo.BoolFromString(discoFile, inDefault);
                    flag3     = SoapServerInfo.BoolFromString(wellKnown, flag3);
                    flag4     = SoapServerInfo.BoolFromString(clientActivated, flag4);
                    string str3 = SoapServerInfo.ServerPhysicalPath(rootWebServer, inBaseUrl, inVirtualRoot, !flag);
                    string str4 = srcTlbPath.ToLower(CultureInfo.InvariantCulture);
                    if (str4.EndsWith("mscoree.dll", StringComparison.Ordinal))
                    {
                        Type typeFromProgID = Type.GetTypeFromProgID(progId);
                        typeName = typeFromProgID.FullName;
                        name     = typeFromProgID.Assembly.GetName().Name;
                    }
                    else if (str4.EndsWith("scrobj.dll", StringComparison.Ordinal))
                    {
                        if (!flag)
                        {
                            throw new ServicedComponentException(Resource.FormatString("ServicedComponentException_WSCNotSupported"));
                        }
                    }
                    else
                    {
                        string           error    = "";
                        GenerateMetadata metadata = new GenerateMetadata();
                        if (flag)
                        {
                            name = metadata.GetAssemblyName(srcTlbPath, str3 + @"\bin\");
                        }
                        else
                        {
                            name = metadata.GenerateSigned(srcTlbPath, str3 + @"\bin\", false, out error);
                        }
                        if (!string.IsNullOrEmpty(name))
                        {
                            try
                            {
                                typeName = this.GetTypeName(str3 + @"\bin\" + name + ".dll", progId, classId);
                            }
                            catch (DirectoryNotFoundException)
                            {
                                if (!flag)
                                {
                                    throw;
                                }
                            }
                            catch (FileNotFoundException)
                            {
                                if (!flag)
                                {
                                    throw;
                                }
                            }
                        }
                    }
                    if ((!string.IsNullOrEmpty(progId) && !string.IsNullOrEmpty(name)) && !string.IsNullOrEmpty(typeName))
                    {
                        DiscoFile file         = new DiscoFile();
                        string    assemblyFile = str3 + @"\bin\" + name + ".dll";
                        if (flag)
                        {
                            SoapServerConfig.DeleteComponent(str3 + @"\Web.Config", name, typeName, progId, assemblyFile);
                            file.DeleteElement(str3 + @"\Default.disco", progId + ".soap?WSDL");
                        }
                        else
                        {
                            SoapServerConfig.AddComponent(str3 + @"\Web.Config", name, typeName, progId, assemblyFile, "SingleCall", flag3, flag4);
                            if (inDefault)
                            {
                                file.AddElement(str3 + @"\Default.disco", progId + ".soap?WSDL");
                            }
                        }
                    }
                    if (!string.IsNullOrEmpty(name))
                    {
                        string fileName = str3 + @"bin\" + name + ".dll";
                        strAssemblyName = new AssemblyManager().GetFullName(fileName);
                    }
                }
            }
            catch (ServicedComponentException exception)
            {
                this.ThrowHelper("Soap_PublishServerTlbFailure", exception);
            }
            catch (RegistrationException exception2)
            {
                this.ThrowHelper("Soap_PublishServerTlbFailure", exception2);
            }
            catch (Exception exception3)
            {
                if ((exception3 is NullReferenceException) || (exception3 is SEHException))
                {
                    throw;
                }
                this.ThrowHelper("Soap_PublishServerTlbFailure", null);
            }
        }
Ejemplo n.º 10
0
        /// <include file='doc\SoapServerTlb.uex' path='docs/doc[@for="SoapServerTlb.AddServerTlb"]/*' />
        public void AddServerTlb(
            string progId,
            string classId,
            string interfaceId,
            string srcTlbPath,
            string rootWebServer,
            string inBaseUrl,
            string inVirtualRoot,
            string clientActivated,
            string wellKnown,
            string discoFile,
            string operation,
            out string strAssemblyName,
            out string typeName
            )
        {
            strAssemblyName = "";
            typeName        = "";
            bool bDelete = false;
            //these are the defaults for these flags
            bool bDiscoFile       = false;
            bool bWellKnown       = false;
            bool bClientActivated = true;

            try
            {
                try
                {
                    SecurityPermission sp = new SecurityPermission(SecurityPermissionFlag.UnmanagedCode);
                    sp.Demand();
                }
                catch (Exception e)
                {
                    if (e.GetType() == typeof(System.Security.SecurityException))
                    {
                        string Error = Resource.FormatString("Soap_SecurityFailure");
                        ComSoapPublishError.Report(Error);
                    }
                    throw;
                }
                Platform.Assert(Platform.Whistler, "SoapServerTlb.AddServerTlb");

                if (null != operation && operation.ToLower(CultureInfo.InvariantCulture) == "delete")
                {
                    bDelete = true;
                }
                //if ProgId is an empty string, it means it does not go in the configuration file
                if (srcTlbPath.Length <= 0)
                {
                    return;
                }
                bDiscoFile       = SoapServerInfo.BoolFromString(discoFile, bDiscoFile);
                bWellKnown       = SoapServerInfo.BoolFromString(wellKnown, bWellKnown);
                bClientActivated = SoapServerInfo.BoolFromString(clientActivated, bClientActivated);
                string PhysicalPath = SoapServerInfo.ServerPhysicalPath(rootWebServer, inBaseUrl, inVirtualRoot, !bDelete);
                string srcdll       = srcTlbPath.ToLower(CultureInfo.InvariantCulture);
                if (srcdll.EndsWith("mscoree.dll"))
                {
                    Type typ = Type.GetTypeFromProgID(progId);
                    typeName = typ.FullName;
                    Assembly     assem     = typ.Assembly;
                    AssemblyName assemname = assem.GetName();
                    strAssemblyName = assemname.Name;
                }
                else if (srcdll.EndsWith("scrobj.dll"))
                {
                    if (!bDelete)
                    {
                        throw new ServicedComponentException(Resource.FormatString("ServicedComponentException_WSCNotSupported"));
                    }
                }
                else
                {
                    string           Error   = "";
                    GenerateMetadata metaGen = new GenerateMetadata();
                    if (bDelete)
                    {
                        strAssemblyName = metaGen.GetAssemblyName(srcTlbPath, PhysicalPath + "\\bin\\");
                    }
                    else
                    {
                        strAssemblyName = metaGen.GenerateSigned(srcTlbPath, PhysicalPath + "\\bin\\", false, out Error);
                    }
                    if (strAssemblyName.Length > 0)
                    {
                        try
                        {
                            //TODO - review GetTypeNameFromProgId to determine if we can use the IID
                            // to simplify the logic
                            typeName = GetTypeName(PhysicalPath + "\\bin\\" + strAssemblyName + ".dll", progId, classId);
                        }
                        catch (Exception e)
                        {
                            if (bDelete && e.GetType() != typeof(System.IO.DirectoryNotFoundException) &&
                                e.GetType() != typeof(System.IO.FileNotFoundException))
                            {
                                throw;
                            }
                        }
                    }
                }
                // pull the generated Assembly.Type from the assembly for configuration files
                if (progId.Length > 0 && strAssemblyName.Length > 0 && typeName.Length > 0)
                {
                    // write to the server configuration files
                    DiscoFile objDiscoFile = new DiscoFile();
                    string    strFileName  = PhysicalPath + "\\bin\\" + strAssemblyName + ".dll";
                    if (bDelete)
                    {
                        SoapServerConfig.DeleteComponent(PhysicalPath + "\\Web.Config", strAssemblyName, typeName, progId, strFileName);
                        objDiscoFile.DeleteElement(PhysicalPath + "\\Default.disco", progId + ".soap?WSDL");
                        // we have no way of telling from a single component what other components are in this type library
                        // metadata assembly.  If we remove from GAC or delete we kill all the other components simultaneously
                        //GacRemove(strFileName);
                        //File.Delete(strFileName);
                    }
                    else
                    {
                        SoapServerConfig.AddComponent(PhysicalPath + "\\Web.Config", strAssemblyName, typeName, progId, strFileName, "SingleCall", bWellKnown, bClientActivated);
                        if (bDiscoFile)
                        {
                            objDiscoFile.AddElement(PhysicalPath + "\\Default.disco", progId + ".soap?WSDL");
                        }
                    }
                }
            }
            catch (Exception e)
            {
                string Error = Resource.FormatString("Soap_PublishServerTlbFailure");
                ComSoapPublishError.Report(Error);
                if (typeof(ServicedComponentException) == e.GetType() || typeof(RegistrationException) == e.GetType())
                {
                    throw;
                }
            }
        }
Ejemplo n.º 11
0
        /// <include file='doc\SoapServerTlb.uex' path='docs/doc[@for="SoapServerTlb.DeleteServerTlb"]/*' />
        public void DeleteServerTlb(
            string progId,
            string classId,
            string interfaceId,
            string srcTlbPath,
            string rootWebServer,
            string baseUrl,
            string virtualRoot,
            string operation,
            string assemblyName,
            string typeName
            )
        {
            try
            {
                SecurityPermission sp = new SecurityPermission(SecurityPermissionFlag.UnmanagedCode);
                sp.Demand();
            }
            catch (Exception e)
            {
                if (e.GetType() == typeof(System.Security.SecurityException))
                {
                    string Error = Resource.FormatString("Soap_SecurityFailure");
                    ComSoapPublishError.Report(Error);
                }
                throw;
            }
            Platform.Assert(Platform.Whistler, "SoapServerTlb.DeleteServerTlb");

            string strAssemblyName = assemblyName;

            if (progId.Length <= 0 && classId.Length <= 0 && assemblyName.Length <= 0 && typeName.Length <= 0)
            {
                return;
            }
            if (baseUrl.Length <= 0 && virtualRoot.Length <= 0)
            {
                return;
            }
            string PhysicalPath = SoapServerInfo.ServerPhysicalPath(rootWebServer, baseUrl, virtualRoot, false);
            string srcdll       = srcTlbPath.ToLower(CultureInfo.InvariantCulture);

            if (srcdll.EndsWith("scrobj.dll"))
            {
                return;                                  //not supported, nothing to do
            }
            if (srcdll.EndsWith("mscoree.dll"))
            {
                Type typ = Type.GetTypeFromProgID(progId);
                typeName = typ.FullName;
                Assembly     assem     = typ.Assembly;
                AssemblyName assemname = assem.GetName();
                strAssemblyName = assemname.Name;
            }
            else
            {
                GenerateMetadata metaGen = new GenerateMetadata();
                strAssemblyName = metaGen.GetAssemblyName(srcTlbPath, PhysicalPath + "\\bin\\");
                if (strAssemblyName.Length > 0)
                {
                    try
                    {
                        //TODO - review GetTypeNameFromProgId to determine if we can use the IID
                        // to simplify the logic
                        typeName = GetTypeName(PhysicalPath + "\\bin\\" + strAssemblyName + ".dll", progId, classId);
                    }
                    catch (Exception e)
                    {
                        if (e.GetType() != typeof(System.IO.DirectoryNotFoundException) &&
                            e.GetType() != typeof(System.IO.FileNotFoundException))
                        {
                            throw;
                        }
                    }
                }
            }
            // pull the generated Assembly.Type from the assembly for configuration files
            if (progId.Length > 0 && strAssemblyName.Length > 0 && typeName.Length > 0)
            {
                // write to the server configuration files
                DiscoFile discoFile   = new DiscoFile();
                string    strFileName = PhysicalPath + "\\bin\\" + strAssemblyName + ".dll";
                SoapServerConfig.DeleteComponent(PhysicalPath + "\\Web.Config", strAssemblyName, typeName, progId, strFileName);
                discoFile.DeleteElement(PhysicalPath + "\\Default.disco", progId + ".soap?WSDL");
                // we have no way of telling from a single component what other components are in this type library
                // metadata assembly.  If we remove from GAC or delete we kill all the other components simultaneously
                //GacRemove(strFileName);
                //File.Delete(strFileName);
            }
        }