FromPath() public static method

Creates a new assembly target for the given location. The only required parameter here is the codebase.
public static FromPath ( Uri codebase, string location = null, string fullname = null ) : IAssemblyTarget
codebase System.Uri /// The URI to the code base. ///
location string /// The location. Must be a valid path and an existing file if supplied--defaults to null. ///
fullname string /// The full name of the assembly. Defaults to null. ///
return IAssemblyTarget
Exemplo n.º 1
0
        /// <inheritdoc/>
        public IAssemblyTarget LoadAssembly(LoadMethod loadMethod, string assemblyPath, string pdbPath = null)
        {
            IAssemblyTarget target   = null;
            var             assembly = this.loader.LoadAssembly(loadMethod, assemblyPath, pdbPath);

            if (loadMethod == LoadMethod.LoadBits)
            {
                // Assemlies loaded by bits will have the codebase set to the assembly that loaded it. Set it to the correct path here.
                var codebaseUri = new Uri(assemblyPath);
                target = AssemblyTarget.FromPath(codebaseUri, assembly.Location, assembly.FullName);
            }
            else
            {
                target = AssemblyTarget.FromAssembly(assembly);
            }

            return(target);
        }