In Development
Last Updated: 17 Nov 2020 12:46 by ADMIN
Eric
Created on: 16 Nov 2020 17:00
Type: Bug Report
0
Exception in net5.0 app

when using JustMock Free in a net 5.0 app.  I am getting an Ninject exception that IAssemblyNameRetriever could not be found.  Looking at the code on github,

the NETCORE compile constant removes the line

AddComponent<IAssemblyNameRetriever, AssemblyNameRetriever>();

from StandardKernel.cs

however, CompiledModuleLoaderPlugin uses IAssemblyNameRetriever in it's constructor and

AddComponent<IModuleLoaderPlugin, CompiledModuleLoaderPlugin>();

is still included in the NETCORE version.

 

 

6 comments
ADMIN
Ivo
Posted on: 17 Nov 2020 12:46

Hello Eric,

I am glad to hear that the temporary fix is working for you. We will let you know once we have an official release for it.

Regards,
Ivo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Eric
Posted on: 17 Nov 2020 12:20

Thanks.

That is exactly what I did. 

ADMIN
Ivo
Posted on: 17 Nov 2020 12:12

Hello Eric,

Thank you for letting us know about this issue. We have made some changes related to another feature and this is the reason for this failure. I have prepared a fix for this issue and we are going to release it shortly. If the problem is a kind of blocking for you, as a temporary solution, you can clone and build JustMock locally using the branch from the pull request.

Regards,
Ivo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Eric
Posted on: 16 Nov 2020 21:36

Once you get the nuget package in the project, just run

ShouldCallConstructorRequiringPrimitiveArgumentConversions

in netcoreapp3.1 and you will get the exception.

 

Eric
Posted on: 16 Nov 2020 21:32

So the problem boils down to Net Core in conjunction with having the nuget package ninject.extensions.conventions in the project.

Once you have those two things, in ModuleLoader.LoadModules, fileGroups ends up having items.

Then:

IModuleLoaderPlugin plugin = plugins.Where(p => p.SupportedExtensions.Contains(extension)).FirstOrDefault();

gets called and one one the plugins is CompiledModuleLoaderPlugin which can't be used as IAssemblyNameRetriever is never mapped.

Let me know if you need more information.

 

ADMIN
Mihail
Posted on: 16 Nov 2020 17:53

Hello Eric,

It seems we are missing a unit test for this scenario. Could you be so kind as to share the test case with which you found this issue?

Regards,
Mihail
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.