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

BadImageFormatException

6 Answers 76 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
DGDev
Top achievements
Rank 2
DGDev asked on 24 Jun 2013, 08:26 PM
VS 2012 +Update 2
.NET 4.5 C# Project
JustMock 2013 Q2
NCrunch
ReSharper

With both NUnit and MSpec unit tests I am constantly receiving a "System.BadImageFormatException : Index not found."

Simple profiled mock:
var config = Mock.Create<ApplicationConfigurationBase>();
Mock.Arrange(() => config.CompositionContainer).Returns(
new CompositionContainer());

It doesn't matter if I use NCrunch or ReSharper's test runner. Both display the exception. I followed the documentation given for NCrunch integration. I've also tried the JustMock_2013.2.624_Dev internal build which led to even worse results and erratic behavior.

Any ideas on how to solve this issue would be much appreciated.

Thanks!

6 Answers, 1 is accepted

Sort by
0
DGDev
Top achievements
Rank 2
answered on 24 Jun 2013, 09:16 PM
I've had to uninstall the commercial version of JustMock. My tests work fine in NCrunch + JustMock Free version, but now I can't do more complex mocking and everything must be virtual. Definitely an issue here.
0
Heiko
Top achievements
Rank 1
answered on 25 Jun 2013, 06:33 AM
I had a similar problem here. A Silverlight project using Telerik components worked perfect until I installed JustMock Q2.2013. The "BadImageFormatException" occured the moment that the first Telerik component was initialized. Reading this post from DGDev I uninstalled JustMock and - presto - the Silverlight project worked like a charm! There is absolutely NO reference to JustMock in my project, but still I got the error.
0
Kaloyan
Telerik team
answered on 25 Jun 2013, 07:31 AM
Hi,

@DGDev
As we fixed a similar bug in JustMock_2013.2.624, can you confirm that after installing it, you have also updated the Telerik.JustMock.* references inside your project? If not, I would suggest:
  1. Install JustMock_2013.2.624_Dev (Internal Build) once again.
  2. Open your project and update all the Telerik.JustMock.* DLLs. Please, use the newly deployed ones inside JustMock\Libraries\.
  3. Check if the issue remains.

If the above does not solve the matter, can you provide a sample project reproducing the issue so we can further investigate it on our side?

@Neils
The issue you are experiencing should be fixed in JustMock_2013.2.624. Please, feel free to check if it works on your side.

Note that, any feedback about our product will be greatly appreciated.

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.
0
DGDev
Top achievements
Rank 2
answered on 25 Jun 2013, 03:20 PM
I've installed the internal build 624, and updated my reference to JustMock. NCrunch does not even run my tests and remains in an odd state. ReSharpers test runner reports the following error:

System.IO.FileLoadException
Could not load file or assembly 'mscorlib, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)

I'll put a sample solution together and post shortly.

UPDATE: I've just sent an example solution in my support ticket. Thanks for looking into this!
0
DGDev
Top achievements
Rank 2
answered on 26 Jun 2013, 02:40 PM
Telerik has just released a new internal build, JustMock_2013.2.624, which fixes these issues completely. I can now use the commercial version of JustMock working alongside NCrunch.

Much thanks to the Telerik devs and support team for putting this fix together so quickly!
0
Accepted
Kaloyan
Telerik team
answered on 27 Jun 2013, 07:19 AM
Hi,

As DGDev pointed, we released another internal build which should fix these issues.

You can download it from here. Just choose JustMock from the drop-down list and download the .msi.

I hope it helps.

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
DGDev
Top achievements
Rank 2
Answers by
DGDev
Top achievements
Rank 2
Heiko
Top achievements
Rank 1
Kaloyan
Telerik team
Share this question
or