This is a migrated thread and some comments may be shown as answers.

TypeLoadException when mocking class System.Net.Http.HttpContent

1 Answer 97 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 1
Joel asked on 08 Jun 2013, 02:27 AM
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: 

1 Answer, 1 is accepted

Sort by
0
Accepted
Kaloyan
Telerik team
answered on 10 Jun 2013, 10:39 AM
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.
Tags
General Discussions
Asked by
Joel
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Share this question
or