Couldn't figure out why this is happening.
System.TypeLoadException was unhandled by user code
HResult=-2146233054
Message=Method 'InternalToString' on type 'HttpEntityExceptionProxy+644d129a7a854c8c9d115708bc631cd4' from assembly 'Telerik.JustMock.Dynamic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is overriding a method that is not visible from that assembly.
Source=mscorlib
TypeName=HttpEntityExceptionProxy+644d129a7a854c8c9d115708bc631cd4
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.FluentMock.Create()
at Telerik.JustMock.Mock.Create(Type target, Action`1 settings)
at Telerik.JustMock.Mock.Create(Type targetType, Constructor constructor, Behavior behavior)
at Telerik.JustMock.Mock.Create[T](Constructor constructor)
at Tests.HttpEntityExceptionExtensions_GetExceptionMessage_with_null_Response_returns_null() in c:\HttpEntityExceptionExtensionsTests.cs:line 34
Currently have JustMock_2013.2.603_Dev.msi installed.
System.TypeLoadException was unhandled by user code
HResult=-2146233054
Message=Method 'InternalToString' on type 'HttpEntityExceptionProxy+644d129a7a854c8c9d115708bc631cd4' from assembly 'Telerik.JustMock.Dynamic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is overriding a method that is not visible from that assembly.
Source=mscorlib
TypeName=HttpEntityExceptionProxy+644d129a7a854c8c9d115708bc631cd4
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.FluentMock.Create()
at Telerik.JustMock.Mock.Create(Type target, Action`1 settings)
at Telerik.JustMock.Mock.Create(Type targetType, Constructor constructor, Behavior behavior)
at Telerik.JustMock.Mock.Create[T](Constructor constructor)
at Tests.HttpEntityExceptionExtensions_GetExceptionMessage_with_null_Response_returns_null() in c:\HttpEntityExceptionExtensionsTests.cs:line 34
// works fine.
var test = Mock.Create<HttpRequestException>(Constructor.Mocked);
// throws exception
var exception = Mock.Create<HttpEntityException>(Constructor.Mocked);
// HttpRequestException is from NuGet Package Microsoft.Net.Http.2.1.10
public
class
HttpEntityException : HttpRequestException
{
public
HttpEntityException(HttpResponseMessage response)
:
base
(response.ReasonPhrase)
{
this
.Response = response;
}
public
HttpStatusCode StatusCode {
get
{
return
this
.Response.StatusCode; } }
public
HttpResponseMessage Response {
get
;
private
set
; }
}
Currently have JustMock_2013.2.603_Dev.msi installed.