TypeLoadException when mocking class System.Net.Http.HttpContent

2 posts, 1 answers
  1. Joel
    Joel avatar
    19 posts
    Member since:
    Dec 2011

    Posted 07 Jun 2013 Link to this post

    var content = Mock.Create<HttpContent>();

    throws:

    System.TypeLoadException was unhandled by user code
      HResult=-2146233054
      Message=Method 'TryComputeLength' in type 'HttpContentProxy+8f0c5d24e08246c69d913c472013ba3d' from assembly 'Telerik.JustMock.DynamicStrong, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8b221631f7271365' does not have an implementation.
      Source=mscorlib
      TypeName=HttpContentProxy+8f0c5d24e08246c69d913c472013ba3d
      StackTrace:
           at System.Reflection.Emit.TypeBuilder.TermCreateClass(RuntimeModule module, Int32 tk, ObjectHandleOnStack type)
           at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock()
           at System.Reflection.Emit.TypeBuilder.CreateType()
           at    .   .   ()
           at Telerik.JustMock.DynamicProxy.Proxy.   ()
           at Telerik.JustMock.DynamicProxy.ProxyFactory.Create()
           at Telerik.JustMock.DynamicProxy.Fluent.FluentProxy.NewInstance()
           at Telerik.JustMock.DynamicProxy.Proxy.Create(Type type, Action`1 action)
           at    .   .   (Type   ,      )
           at    .   .   (     )
           at    .   .   (Behavior    , Boolean    )
           at    .   .   ()
           at Telerik.JustMock.Mock.Create(Type target, Behavior behavior, Object[] args)
           at Telerik.JustMock.Mock.Create(Type target, Object[] args)
           at Telerik.JustMock.Mock.Create[T]()
           at TEST() in c:\xxx.cs:line 61
      InnerException: 

  2. Answer
    Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 10 Jun 2013 Link to this post

    Hi Joel,

    Thank you for reporting this issue.

    I am glad to say, we have already fixed it. You could try our latest internal build (JustMock 2013.2.603) where the fix is present. You could find it here.

    Regards,
    Kaloyan
    Telerik
    Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
  3. DevCraft R3 2016 release webinar banner
Back to Top