The “EnsureBindingRedirects” task failed unexpectedly

后端 未结 14 2161
甜味超标
甜味超标 2021-02-06 20:56

When I create new ASP.NET 4.5 web forms application from vs2012 and update all nuget packages, I receive this error on build:

14条回答
  •  渐次进展
    2021-02-06 21:36

    I had this error but slightly different, took me 45 minutes to figure it out so thought I'd better get this out there.

    Was experiencing the "EnsureBindingRedirects" task failed unexpectedly problem but mine came from an XmlException:

    (...)\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets(97,5): error MSB4018: System.Xml.XmlException: '=' is an unexpected token. The expected token is ';'. Line 39, position 175.

    Turns out the cause was that I'd recently added an entry to my web.config's appSettings where the value was a URL that contained an ampersand (&).

    Ampersands need to be escaped in XML, even in attribute values.

    I changed all the & in the URL value to & and it built without issue.

提交回复
热议问题