/// Constructor public CSharpCompiler(IWriteVerbose logWriter) { _verboseWriter = logWriter ?? new NullVerboseWriter(); _using = new Dictionary <string, bool>(); _references = new List <Ref>(); _headers = new List <string>(); _notLoadedReferences = new Dictionary <Ref, string>(); }
public Assembly ForceLoad(IWriteVerbose writer) { writer.WriteVerbose("Loader> Loading " + Name + " from " + From); Assembly a = null; if (!string.IsNullOrEmpty(From)) { string dll = Path.GetFullPath(From); if (From.IndexOfAny(new char[] { '/', '\\' }) != -1 || File.Exists(dll)) { a = Assembly.LoadFrom(dll); } } if (a == null && !string.IsNullOrEmpty(Name)) { try { // Yeah, I know it's deprecated, and it's best to use full assembly names, but // but I don't really want to scan GAC myself #pragma warning disable 618 a = Assembly.LoadWithPartialName(Name); #pragma warning restore 618 } catch (FileNotFoundException) { writer.WriteVerbose("Loader> Failed to load partial " + Name); } } // If we have an assembly, store full path to it if (a != null) { From = a.Location; Name = a.FullName; writer.WriteVerbose("Loader> Successfully loaded " + a.FullName + " at " + a.Location); return(a); } throw new FileNotFoundException("Failed to load assembly " + Name + " or one of its dependencies", From); }
public DownloadState(IWriteVerbose writeVerbose) { _writeVerbose = writeVerbose; }
/// Constructor public CSharpCompiler(IWriteVerbose logWriter) { _verboseWriter = logWriter??new NullVerboseWriter(); _using = new Dictionary<string, bool>(); _references = new List<Ref>(); _headers = new List<string>(); _notLoadedReferences = new Dictionary<Ref, string>(); }
public Assembly ForceLoad(IWriteVerbose writer) { writer.WriteVerbose("Loader> Loading " + Name + " from " + From); Assembly a = null; if (!string.IsNullOrEmpty(From)) { string dll = Path.GetFullPath(From); if (From.IndexOfAny(new char[]{'/','\\'})!=-1 || File.Exists(dll)) a = Assembly.LoadFrom(dll); } if (a==null && !string.IsNullOrEmpty(Name)) { try { // Yeah, I know it's deprecated, and it's best to use full assembly names, but // but I don't really want to scan GAC myself #pragma warning disable 618 a = Assembly.LoadWithPartialName(Name); #pragma warning restore 618 } catch (FileNotFoundException) { writer.WriteVerbose("Loader> Failed to load partial " + Name); } } // If we have an assembly, store full path to it if (a != null) { From = a.Location; Name = a.FullName; writer.WriteVerbose("Loader> Successfully loaded " + a.FullName + " at " + a.Location); return a; } throw new FileNotFoundException("Failed to load assembly " + Name+" or one of its dependencies",From); }