Repository: dotnet/efcore
File: src/dotnet-ef/Project.cs (C#)

Code before:
        args.Add(file);

        var output = new StringBuilder();

        var exitCode = Exe.Run("dotnet", args, handleOutput: line => output.AppendLine(line));
        if (exitCode != 0)
        {
            if (framework == null && HasMultipleTargetFrameworks(file))
            {
                throw new CommandException(Resources.MultipleTargetFrameworks);
            }

            throw new CommandException(Resources.GetMetadataFailed);
        }

        var metadata = JsonSerializer.Deserialize<ProjectMetadata>(output.ToString())!;

        var runtimeCopyLocalItems = metadata.Items["RuntimeCopyLocalItems"];

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

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

        var platformTarget = properties[nameof(PlatformTarget)];
        if (platformTarget.Length == 0)
        {
            platformTarget = properties["Platform"];
        }

        return new Project(file, framework, configuration, runtime)
        {
            AssemblyName = properties[nameof(AssemblyName)],
            DesignAssembly = designAssembly,
            Language = properties[nameof(Language)],
            OutputPath = normalizedOutputPath,
            PlatformTarget = platformTarget,
            ProjectAssetsFile = properties[nameof(ProjectAssetsFile)],
            ProjectDir = properties[nameof(ProjectDir)],
            RootNamespace = properties[nameof(RootNamespace)],
            RuntimeFrameworkVersion = properties[nameof(RuntimeFrameworkVersion)],
            TargetFileName = properties[nameof(TargetFileName)],
            TargetFrameworkMoniker = properties[nameof(TargetFrameworkMoniker)],
            Nullable = properties[nameof(Nullable)],
            TargetFramework = properties[nameof(TargetFramework)],
            TargetPlatformIdentifier = properties[nameof(TargetPlatformIdentifier)]
        };

Review comment (suggestion):
@copilot Also apply this normalization to DesignAssembly, ProjectAssetsFile and ProjectDir.
Afterwards try the scenario again using the dotnet-ef tool built with these fixes to verify there are no regressions.

Code after:
        args.Add(file);

        var output = new StringBuilder();

        var exitCode = Exe.Run("dotnet", args, handleOutput: line => output.AppendLine(line));
        if (exitCode != 0)
        {
            if (framework == null && HasMultipleTargetFrameworks(file))
            {
                throw new CommandException(Resources.MultipleTargetFrameworks);
            }

            throw new CommandException(Resources.GetMetadataFailed);
        }

        var metadata = JsonSerializer.Deserialize<ProjectMetadata>(output.ToString())!;

        var runtimeCopyLocalItems = metadata.Items["RuntimeCopyLocalItems"];

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

        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)];
        if (platformTarget.Length == 0)
        {
            platformTarget = properties["Platform"];
        }

        return new Project(file, framework, configuration, runtime)
        {
            AssemblyName = properties[nameof(AssemblyName)],
            DesignAssembly = designAssembly,
            Language = properties[nameof(Language)],
            OutputPath = normalizedOutputPath,
            PlatformTarget = platformTarget,
            ProjectAssetsFile = normalizedProjectAssetsFile,
            ProjectDir = normalizedProjectDir,
            RootNamespace = properties[nameof(RootNamespace)],
            RuntimeFrameworkVersion = properties[nameof(RuntimeFrameworkVersion)],
            TargetFileName = properties[nameof(TargetFileName)],
            TargetFrameworkMoniker = properties[nameof(TargetFrameworkMoniker)],
            Nullable = properties[nameof(Nullable)],