Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Patrik 37 posts 89 karma points
    Jan 08, 2014 @ 08:51
    Patrik
    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)

     

    {"Message":"The requested resource does not support http method 'GET'."}

    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

  • Per Ploug 865 posts 3491 karma points MVP admin
    Jan 08, 2014 @ 15:15
    Per Ploug
    100

    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

  • Patrik 37 posts 89 karma points
    Jan 08, 2014 @ 15:35
    Patrik
    0

    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>

  • Marc Goodson 2157 posts 14431 karma points MVP 9x c-trib
    Jan 12, 2014 @ 01:23
    Marc Goodson
    1

    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>

  • Patrik 37 posts 89 karma points
    Jan 13, 2014 @ 09:20
    Patrik
    0

    @Marc Goodson,

    You're correct, a typo from my side!

  • BenH 59 posts 199 karma points
    Mar 17, 2014 @ 19:28
    BenH
    0

    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> 

Please Sign in or register to post replies

Write your reply to:

Draft