Type A originates from 'System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' in the context 'Default'
at location 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\1da1f76f\32714b31\assembly\dl3\6c468757\5d5601e2_8b0bcf01\System.Net.Http.dll'.
Type B originates from 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' in the context 'Default'
at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll'.
I also ran into this error on 7.0.4 using the NuGet version installed with Visual Studio 2012. I changed the following version number from 2.0.0.0 to 4.0.0.0
Error when creating new media
Hi,
I have problems when trying to upload images via the back office. In the developer console it says:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
And a red error message is shown on the page:
Server error: Contact administrator, see log for full details.
[A]System.Net.Http.Headers.ContentDispositionHeaderValue cannot be cast to
[B]System.Net.Http.Headers.ContentDispositionHeaderValue.
Type A originates from 'System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' in the context 'Default'
at location 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\1da1f76f\32714b31\assembly\dl3\6c468757\5d5601e2_8b0bcf01\System.Net.Http.dll'.
Type B originates from 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' in the context 'Default'
at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll'.
I'm using Umbraco 7.0.1 downloaded via Nuget.
Any help much appreciated!
/Patrik
Hi Patrik
I think this is a redirect binding being wrong, more details here:
http://stackoverflow.com/questions/16967134/odd-exception-scenario-system-net-http-mediatypeheadervalue-cannot-be-cast-to-me
/Per
Thank you Per, that solved it!
Changed from:
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
To:
<dependentAssembly>
<assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" />
<bindingRedirect oldVersion="1.4.5.0-1.4.6.0" newVersion="1.4.6.0" />
</dependentAssembly>
Thanks, this resolved the issue for me, but it was just an ammend to the System.Net.Http one, think the HtmlAgilityPack one is fine? eg:
Change
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
to:
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
@Marc Goodson,
You're correct, a typo from my side!
I also ran into this error on 7.0.4 using the NuGet version installed with Visual Studio 2012. I changed the following version number from 2.0.0.0 to 4.0.0.0
Fromt:
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
To:
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
is working on a reply...