Skip to content

DotNet proxy tool fails when project is in a path with spaces #974

@woksin

Description

@woksin

I discovered that that build tool fails when building a project that is in a directory with space in its path. Here is the Cratis.Applications.ProxyGenerator.Build.targets segment that causes this. Second argument of the dotnet command causes this issue when there are spaces in the path. So either we have to escape the spaces in the string or we can probably surround the argument with " " quotes

<Target Name="CratisProxyGenerator" AfterTargets="AfterBuild"> 
        <Message Text="MSBuildProjectDirectory : $(MSBuildProjectDirectory)" Importance="high" />
        <Message Text="OutputPath : $(OutputPath)" Importance="high" />
        <Message Text="AssemblyName : $(AssemblyName)" Importance="high" />
        <Message Text="ProxyGenerator base directory : $(CratisProxyGeneratorAssemblyDirectory)" Importance="high" />
        <Message Text="Full path to assembly : $(MSBuildProjectDirectory)/$(OutputPath)$(AssemblyName).dll" Importance="high" />
        
        <PropertyGroup>
            <SkipOutputDeletion Condition=" '$(CratisProxiesSkipOutputDeletion)' == 'true' ">--skip-output-deletion</SkipOutputDeletion>
        </PropertyGroup>

        <Exec ConsoleToMsBuild="true" Command="dotnet $(CratisProxyGeneratorAssembly) $(MSBuildProjectDirectory)/$(OutputPath)$(AssemblyName).dll $(CratisProxiesOutputPath) $(CratisProxiesSegmentsToSkip) $(SkipOutputDeletion)" WorkingDirectory="$(CratisProxyGeneratorAssemblyDirectory)" />
</Target>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions