Nop 4.40.X stops working with Nop-Templates if you install .NET 6/VS 2022 for 4.50

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 years ago
Hope this helps others. Also a question for the NopCommerce team as Nop-Templates say this is a known bug in NopCommerce.

We encountered an issue where we started getting these errors after installing the .NET 6 hosting bundle both on server and local machine (if you load Nop 4.40 in VS 2022).

ReflectionTypeLoadException: Unable to load one or more of the requested types.
Return type in method 'SevenSpikes.Nop.Plugins.AnywhereSliders.Models.SlidePublicModel.$()' on type 'SevenSpikes.Nop.Plugins.AnywhereSliders.Models.SlidePublicModel' from assembly 'SevenSpikes.Nop.Plugins.AnywhereSliders, Version=4.4.954.34874, Culture=neutral, PublicKeyToken=null' is not compatible with base type method 'Nop.Web.Framework.Models.BaseNopEntityModel.$()'.
Return type in method 'SevenSpikes.Nop.Plugins.AnywhereSliders.Models.Sliders.SlideModel.$()' on type 'SevenSpikes.Nop.Plugins.AnywhereSliders.Models.Sliders.SlideModel' from assembly 'SevenSpikes.Nop.Plugins.AnywhereSliders, Version=4.4.954.34874, Culture=neutral, PublicKeyToken=null' is not compatible with base type method 'Nop.Web.Framework.Models.BaseNopEntityModel.$()'.


I contacted Nop-Templates support who quickly told me this is a known issue but in NopCommerce, not their software and it is caused by VS 2022. In fact we found our build machine had also stopped working.

I fixed it on the build machine by adding to the "src" folder a global.json with the following in it:
{
  "sdk": {
    "version": "5.0.200"
  }
}

That corresponds to the Version 5 SDK I have installed. You can check what V5 SDK you have by typing "dotnet --info" at the command line.

So basically, if the 6.X.X version of the dotnet SDK is used, your site will break if you are using Nop-Templates.

Would be good if this could be resolved by NopCommerce though!
2 years ago
fireblade669 wrote:

I contacted Nop-Templates support who quickly told me this is a known issue but in NopCommerce, not their software and it is caused by VS 2022.


Yes this is correct assertion and a known problem. I couldn't get nop 4.4x working during in runtime when it was complied with VS 2022.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.