Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/dotnet-ef/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ public static Project FromFile(

var designAssembly = runtimeCopyLocalItems
.Select(i => i["FullPath"])
.FirstOrDefault(i => i.Contains("Microsoft.EntityFrameworkCore.Design", StringComparison.InvariantCulture));
.FirstOrDefault(i => i.Contains("Microsoft.EntityFrameworkCore.Design", StringComparison.InvariantCulture))
?.Replace('\\', Path.DirectorySeparatorChar);
var properties = metadata.Properties;

var outputPath = Path.GetFullPath(Path.Combine(properties[nameof(ProjectDir)]!, properties[nameof(OutputPath)]!));
var normalizedOutputPath = properties[nameof(OutputPath)]!.Replace('\\', Path.DirectorySeparatorChar);
var normalizedProjectDir = properties[nameof(ProjectDir)]!.Replace('\\', Path.DirectorySeparatorChar);
var normalizedProjectAssetsFile = properties[nameof(ProjectAssetsFile)]?.Replace('\\', Path.DirectorySeparatorChar);
var outputPath = Path.GetFullPath(Path.Combine(normalizedProjectDir, normalizedOutputPath));
CopyBuildHost(runtimeCopyLocalItems, outputPath);

var platformTarget = properties[nameof(PlatformTarget)];
Expand All @@ -116,10 +120,10 @@ public static Project FromFile(
AssemblyName = properties[nameof(AssemblyName)],
DesignAssembly = designAssembly,
Language = properties[nameof(Language)],
OutputPath = properties[nameof(OutputPath)],
OutputPath = normalizedOutputPath,
PlatformTarget = platformTarget,
ProjectAssetsFile = properties[nameof(ProjectAssetsFile)],
ProjectDir = properties[nameof(ProjectDir)],
ProjectAssetsFile = normalizedProjectAssetsFile,
ProjectDir = normalizedProjectDir,
RootNamespace = properties[nameof(RootNamespace)],
RuntimeFrameworkVersion = properties[nameof(RuntimeFrameworkVersion)],
TargetFileName = properties[nameof(TargetFileName)],
Expand Down
3 changes: 1 addition & 2 deletions src/dotnet-ef/RootCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ protected override int Execute(string[] _)
Path.GetDirectoryName(typeof(Program).Assembly.Location)!,
"tools");

var targetDir = Path.GetFullPath(Path.Combine(startupProject.ProjectDir!, startupProject.OutputPath!))
.Replace('\\', Path.DirectorySeparatorChar);
var targetDir = Path.GetFullPath(Path.Combine(startupProject.ProjectDir!, startupProject.OutputPath!));
var targetPath = Path.Combine(targetDir, project.TargetFileName!);
var startupTargetPath = Path.Combine(targetDir, startupProject.TargetFileName!);
var depsFile = Path.Combine(
Expand Down