azure-pipelines-build-taskoctopack

How do I avoid invalid characters in XML files using OctoPack during VSTS builds?


I am seeing these errors during builds.

C:\Program Files (x86)\Microsoft WCF Data Services\5.6.4\bin\.NETFramework\Microsoft.Data.Services.Client.xml' contains invalid characters.
C:\Program Files (x86)\Microsoft WCF Data Services\5.6.4\bin\.NETFramework\Microsoft.Data.OData.xml' contains invalid characters
C:\Program Files (x86)\Microsoft WCF Data Services\5.6.4\bin\.NETFramework\Microsoft.Data.Edm.xml' contains invalid characters.
C:\Program Files (x86)\Microsoft WCF Data Services\5.6.4\bin\.NETFramework\System.Spatial.xml' contains invalid characters.

I dont get them locally when I run MsBuild with the same arguements, and I can even run MSBuild on the private build agent just fine too.

I have other projects using OctoPack just fine, and using these packages. I am going to double check them very carefully because the other ones work just fine.


Solution

  • The problem is solved by upgrading the affected packages from 5.6.4 to 5.7.0 (current latest build).

    I spent a good couple of hours trying to figure this out. I figured I could save others the time by posting a question I would have asked, and the answer too.

    Also make sure that the App.config/web.config of your main target also has binding redirects:

    <dependentAssembly>
            <assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-5.7.0.0" newVersion="5.7.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-5.7.0.0" newVersion="5.7.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-5.7.0.0" newVersion="5.7.0.0" />
          </dependentAssembly>
    

    You may have these in a service/utility project within your solution, but if they are not present in the main config file of your "deployable" target, they will be ignored and you might still pick up references to

    C:\Program Files (x86)\Microsoft WCF Data Services\5.6.4
    

    Versions of the DLLs, and not the NuGet packaged versions you intended, from your "packages" folder.