Using a Razor Class Library inside an Orchard Core Module #17056
-
Hello everyone, i hope you can help me. As the Title suggests i have a Module in which i plan to use a RCL which is also used in another ASP.NET Core application. When creating a ViewComponent inside the Module everything works fine. When i reference the RCL and try to use a ViewComponent i get an InvalidOperationException which states, that the ViewComponent could not be found. The Other Application i mentioned (Razor Pages) does not have any problems. I put together some Sample Code to show you: https://github.com/max-roeder/OrchardRCLTest. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Why not using your views directly from within the OC Module itself? |
Beta Was this translation helpful? Give feedback.
-
I finally managed to get this working. After Adding Mvc and the ApplicationPart for my Assembly explicitly and adding an EmbeddedFileProvider for my AddRazorRuntimeCompilation i only needed to tweak the path in my ViewComponent it now finds the ViewComponent and the corresponding View. I updated everything on my Sample Application https://github.com/max-roeder/OrchardRCLTest. |
Beta Was this translation helpful? Give feedback.
I finally managed to get this working. After Adding Mvc and the ApplicationPart for my Assembly explicitly and adding an EmbeddedFileProvider for my AddRazorRuntimeCompilation i only needed to tweak the path in my ViewComponent it now finds the ViewComponent and the corresponding View. I updated everything on my Sample Application https://github.com/max-roeder/OrchardRCLTest.