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

Mock.Create<>() requiring strong name

1 Answer 99 Views
JustMock Free Edition
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 30 Mar 2018, 05:00 PM

There is one interface where when I try to mock it it throws an exceptions

System.IO.FileLoadException : Could not load file or assembly 'MyFramework, Version=2017.12.12.1, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required.

None of our projects are strong named, and my best guess is that it has something to do with the nature of the interface we're trying to mock. For simplicity sake I'll describe our project like this:

  • Processor --the project I'm actually testing
  • Processor.Tests --The project the tests are running from
  • MyFramework.Lib --The project that contains the interface (IMessageLogger) I'm trying to mock
  • MyFramework --internal dll that all projects reference

One of the methods in the IMessageLogger interface has an argument where the type is defined in the MyFramework project.

When I call Mock.Create<IMessageLogger>() I get the error above. My only thought is that because the Telerik.JustMock assembly is strong named, it is for some reason having trouble loading the MyFramework assemble even though it can miraculously load the MyFramework.Lib assembly.

I was wondering if there is any workaround I might be able to try so that I can mock this piece. I can live without mocking this specific interface, but I may not be so lucky with others...

1 Answer, 1 is accepted

Sort by
0
Lyubomir Rusev
Telerik team
answered on 04 Apr 2018, 02:53 PM
Hello Jeremy,

We came across the following Stack Overflow thread:

https://stackoverflow.com/questions/49578624/mock-create-requiring-strong-name

From there we came to the assumption that you have managed to fix the issue. Feel free to contact us if you need additional help.

Regards,
Lyubomir Rusev
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
JustMock Free Edition
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Lyubomir Rusev
Telerik team
Share this question
or