MissingMethodException - Cannot create an instance of an interface when calling A.Fake<ITest> when debugging
See original GitHub issuewhen I debug MSUnit test code I get
System.MissingMethodException occurred
Message=Cannot create an instance of an interface.
Source=mscorlib
StackTrace:
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
InnerException:
on the first A.Fake<ITest>()
call
ITest tt = A.Fake<ITest>();
It runs normally when I just run tests. so it happens only under visual studio debugger. what is is missing?
windows7/VS2010 ultimate/FakeItEasy 1.7.4626.65 Started recently… not sure what changed.
Issue Analytics
- State:
- Created 11 years ago
- Comments:51 (34 by maintainers)
Top Results From Across the Web
MissingMethodException [Cannot create an instance of an ...
Really the explanation is in the message i.e. it can't create an instance of the interface, as you've said the constructor is cool, ......
Read more >ASP.NET MVC – Cannot create an instance of an interface
I came across an error message recently that I hadn't seen before: The error occurred when I tried submitting the following form: The...
Read more >Cannot create an instance of an interface while creating .net ...
Re: System. MissingMethodException: Cannot create an instance of an interface while creating . net object.
Read more >Cannot create an instance of an interface - question
Hi, Just added HangFire to my MVC project. I have a Service Layer which has an interface and then the implementation.
Read more >Debug C# interface implemenation located in nuget package
I have 4 projects: Project FarmCLI is the main project (.NET Core web application) Project Animal is a class library in a NuGet...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is this not a case of having “Break when an exception is thrown” checked?
That, and Just My Code disabled