System.Runtime.Remoting.RemotingConfigHandler.RemotingConfigInfo.LoadType C# (CSharp) Method

LoadType() static private method

static private LoadType ( String typeName, String assemblyName ) : Type
typeName String
assemblyName String
return Type
            internal static Type LoadType(String typeName, String assemblyName)
            {
                Assembly asm = null;                                               
                // All the LoadType callers have been protected by 
                // Infrastructure LinkDemand, it is safe to assert
                // this permission. 
                // Assembly.Load demands FileIO when the target 
                // assembly is the same as the executable running.
                new FileIOPermission(PermissionState.Unrestricted).Assert();
                try {                    
                    asm = Assembly.Load(assemblyName);
                }
                finally {
                    CodeAccessPermission.RevertAssert();
                }
                
                if (asm == null)
                {
                    throw new RemotingException(
                        String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_AssemblyLoadFailed"),
                        assemblyName));                    
                }

                Type type = asm.GetType(typeName, false, false);
                if (type == null)
                {
                    throw new RemotingException(
                        String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_BadType"),
                        typeName + ", " + assemblyName));     
                }

                return type;
            } // LoadType