Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

o build-wrap FormatException #291

Closed
chriseldredge opened this issue Jan 5, 2012 · 1 comment
Closed

o build-wrap FormatException #291

chriseldredge opened this issue Jan 5, 2012 · 1 comment

Comments

@chriseldredge
Copy link

When "o build-wrap" invokes msbuild, if the build output includes any curly braces, such as is the case when it cannot resolve an assembly reference, the command will fail due to a FormatException.

In practice this can happen when a csproj includes an unused reference to an assembly that cannot be resolved, and msbuild emits output similar to:

  Primary reference "Microsoft.SqlServer.TxScript, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL".
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.SqlServer.TxScript, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. 
          For SearchPath "{TargetFrameworkDirectory}".
          Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\Microsoft.SqlServer.TxScript.dll", but it didn't exist.```

The {TargetFrameworkDirectory} line is the one that causes the problem.

The problem appears in BuildWrapCommand:409 because the output line is treated as a message format instead of being treated as a literal.
@chriseldredge
Copy link
Author

Sample project that would trigger this error:

<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Target Name="Clean"/>

    <Target Name="Build">
        <Message Text="{this text is in curly braces.}"/>
    </Target>
</Project>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants