BadImageFormatException

7 posts, 1 answers
  1. DGDev
    DGDev avatar
    42 posts
    Member since:
    Jul 2012

    Posted 24 Jun 2013 Link to this post

    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!
  2. DGDev
    DGDev avatar
    42 posts
    Member since:
    Jul 2012

    Posted 24 Jun 2013 Link to this post

    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.
  3. DevCraft R3 2016 release webinar banner
  4. Heiko
    Heiko avatar
    123 posts
    Member since:
    Oct 2012

    Posted 25 Jun 2013 Link to this post

    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.
  5. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 25 Jun 2013 Link to this post

    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.
  6. DGDev
    DGDev avatar
    42 posts
    Member since:
    Jul 2012

    Posted 25 Jun 2013 Link to this post

    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!
  7. DGDev
    DGDev avatar
    42 posts
    Member since:
    Jul 2012

    Posted 26 Jun 2013 Link to this post

    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!
  8. Answer
    Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 27 Jun 2013 Link to this post

    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.
Back to Top
DevCraft R3 2016 release webinar banner