Skip to content

Commit 01e9fd0

Browse files
committed
added workaround for ImplicitNamespace file path
1 parent 93f6115 commit 01e9fd0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/Scaffolding/VS.Web.CG.Utils/Workspaces/RoslynWorkspace.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,17 @@ private ProjectId AddProject(IProjectContext context, string configuration)
9393
: Path.Combine(Path.GetDirectoryName(fullPath), file);
9494
AddSourceFile(projectInfo, filePath);
9595
}
96-
9796
if (!string.IsNullOrEmpty(context.GeneratedImplicitNamespaceImportFile) && !string.IsNullOrEmpty(fullPath))
9897
{
9998
var namespaceImportsFilePath = Path.Combine(Path.GetDirectoryName(fullPath), context.GeneratedImplicitNamespaceImportFile);
10099
AddSourceFile(projectInfo, namespaceImportsFilePath);
101100
}
102-
101+
// manually add the ImplicitImports.cs file.
102+
else
103+
{
104+
var namespaceImportsFilePath = $"{context.TargetDirectory.Replace("\\bin\\", "\\obj\\")}\\{context.ProjectName}.ImplicitNamespaceImports.cs";
105+
AddSourceFile(projectInfo, namespaceImportsFilePath);
106+
}
103107

104108
return projectInfo.Id;
105109
}

0 commit comments

Comments
 (0)