Skip to content

Commit

Permalink
Workaround VS caching issue - fixes #586
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamTheCoder committed Jul 4, 2020
1 parent fb4b09a commit 3bfd760
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CodeConverter/CSharp/ProjectExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ public static ProjectInfo ToProjectInfo(this Project project, ProjectId projectI

public static Project ToProjectFromAnyOptions(this Project project, CompilationOptions compilationOptions, ParseOptions parseOptions)
{
var projectInfo = project.ToProjectInfo(project.Id, project.Name, compilationOptions,
// Use a new id to workaround VS caching issue first reported here: https://github.com/icsharpcode/CodeConverter/issues/586
var newProjectId = ProjectId.CreateNewId("ConvertedProject");
var projectInfo = project.ToProjectInfo(newProjectId, project.Name, compilationOptions,
project.ProjectReferences, parseOptions);
var convertedSolution = project.Solution.RemoveProject(project.Id).AddProject(projectInfo);
return convertedSolution.GetProject(project.Id);
return convertedSolution.GetProject(newProjectId);
}

public static string GetDirectoryPath(this Project proj)
Expand Down

0 comments on commit 3bfd760

Please sign in to comment.