Custom Module reference in .NETCore Project (Live Site)

Laszlo Csabi asked on February 29, 2024 02:50

Hi all,

I am trying to get my head around the following problem. I have a custom module "CSUCore". I have several customisation in that module one of them is a Custome Shipping Provider. That Custom Module is in a separate assembly using .NET4.8 Framework and it is referenced in CMSApp.

Once I start using the Live site ( .NEtCore) and I am on the checkout process the Live site throws an exception that cannot find the CSUCore module when I try to calculate the shipping prices.

If I add the CSUCore module to the .NEtCore live site as a reference then it complains about that is in .NET4.8 framework and won't run it.

What is the best practice you can recommend me to overcome this issue. What is the solution here?

Thanks Las

Correct Answer

Liam Goldfinch answered on February 29, 2024 09:27

Yes this is what we do for KX13, any shared code lives in a .NET Standard 2.0 project that is referenced by both the .NET Core project and the CMSApp

1 votesVote for this answer Unmark Correct answer

Recent Answers


Juraj Ondrus answered on February 29, 2024 07:24

I am using .NET Framework 4.8 for custom module classes like for scheduled tasks, Azure storage, event handler and they work all fine. I do not know the code of your module class but maybe I would try using .NET Standard.

0 votesVote for this answer Mark as a Correct answer

Laszlo Csabi answered on February 29, 2024 07:46

I had no problem with Scheduled Tasks and events either. I have custom providers such as CsutomShoppingCartInfoProvider, CustomShippingOptionProvider. When I try to interact with Shipping Methods on the .NetCore Live website especially when trying to calculate the Shipping Cost, then the site throws the exception and complains about cannot find the custom module assemblies.

So, If I convert the .NET 4.8 Class Library to .NETStandars2.0 it could be uses and referenced both on the CMSApPp and the .NEtCore app as well, right?

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on March 1, 2024 05:39

Make also sure that your custom module class is not using anything related to the admin app - like some controls or API which is available just for the web forms, admin app. The live site app's NuGet packages contain only API related to the live site. So, if your custom module is using any controls or code from the web forms, admin app, it will most likely cause issues in the front end .NET Core app.

1 votesVote for this answer Mark as a Correct answer

Laszlo Csabi answered on March 1, 2024 05:45

Thanks @Juraj. That bit of information helped. I have been able to convert the Custom Module to .NEt Standard 2.1 and also made sure I don't have any code which references the admin app

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.