protected void Init() { try { Workspace = new AdhocWorkspace(); Workspace.AddSolution(SolutionInfo.Create(MSSolutionID.CreateNewId(), VersionStamp.Default)); References = new List <string>(DefaultReferences); } catch (ReflectionTypeLoadException ex) { StringBuilder sb = new StringBuilder(); foreach (Exception exSub in ex.LoaderExceptions) { sb.AppendLine(exSub.Message); if (exSub is FileNotFoundException exFileNotFound) { if (!string.IsNullOrEmpty(exFileNotFound.FusionLog)) { sb.AppendLine("Fusion Log:"); sb.AppendLine(exFileNotFound.FusionLog); } } sb.AppendLine(); } string errorMessage = sb.ToString(); //Display or log the error based on your application. throw; } }
public SolutionAttributes(SolutionId id, VersionStamp version, string?filePath) { Id = id; Version = version; FilePath = filePath; }
/// <summary> /// Create a new empty solution instance associated with this workspace. /// </summary> protected internal Solution CreateSolution(SolutionId id) { return(CreateSolution(SolutionInfo.Create(id, VersionStamp.Create()))); }
public SolutionAttributes(SolutionId id, VersionStamp version, string filePath) { Id = id ?? throw new ArgumentNullException(nameof(id)); Version = version; FilePath = filePath; }
public CustomWorkspace(SolutionId solutionId) : this(WorkspaceKind.Host) { this.SetCurrentSolution(this.CreateSolution(solutionId)); }