MSBuild common errors and how to fix them

Building with MSBuild produced an error or warning

Run ms build with (d)etaild verbose mode

1
msbuild someproject.csproj /t:Clean;Build;Transfer /p:OutputPath=bin\autobuild;BuildNumber=-1;Configuration=Debug /v:d >build.txt

Open and find the build.txt and find the MSBXXXX error/warning

1
2
Consider app.config remapping of assembly "DotNetOpenAuth.AspNet, Culture=neutral, PublicKeyToken=2780ccd10d57b246" from Version "4.0.0.0" [] to Version "4.1.0.0" [C:\somedir\bin\DotNetOpenAuth.AspNet.dll] to solve conflict and get rid of warning.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.

If not already exist add an “App.config” file with the following content

1
2
3
4
5
6
7
8
9
10
11
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
                <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

Also change your .csproject to include the App.config file

1
2
3
  <ItemGroup>
    <None Include="App.config" />
  </ItemGroup>
This entry was posted in C# and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


two + = 11