Copied to clipboard

Flag this post as spam?

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


  • Pete Fullergreen 5 posts 35 karma points
    Mar 05, 2014 @ 11:33
    Pete Fullergreen
    0

    Error uploading Media

    I'm finding the Umbraco 7 backend UI a little annoying, in the way that it just sometimes fails quietly.

    I'm trying to add media (an image) in a rich text editor - nothing happens. I tried adding it directly on the media tab, and nothing happened. I created an image and tried to upload there, and I finally got an error message:

     

    An error occurred


    [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:\Users\peter.fullergreen\AppData\Local\Temp\Temporary ASP.NET Files\root\839fa9f4\3637028b\assembly\dl3\1f072045\00885820_947cce01\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'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidCastException: [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:\Users\peter.fullergreen\AppData\Local\Temp\Temporary ASP.NET Files\root\839fa9f4\3637028b\assembly\dl3\1f072045\00885820_947cce01\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'.

    Stack Trace:

    at System.Net.Http.Headers.HttpContentHeaders.get_ContentDisposition()
       at Umbraco.Web.WebApi.Binders.ContentItemBaseBinder`2.<GetModel>d__5.MoveNext()
    What do I need to do to get past this? I'm running locally on my own machine, so permissions cannot be an issue.
  • Razor 1 post 41 karma points
    Mar 05, 2014 @ 13:15
    Razor
    100

    Change your Web.config:

    <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>

     

    For me it works in an earlier project.

  • Pete Fullergreen 5 posts 35 karma points
    Mar 05, 2014 @ 15:11
    Pete Fullergreen
    0

    That worked perfectly, thanks very much!

Please Sign in or register to post replies

Write your reply to:

Draft