How to create a "library" module (no UI i.e. razor components)? #4192
-
In the DNN world there is an extension type called "library". This is for cases where no UI is needed - e.g. it installs functionality that is shared by other regular modules, or installs server-based functionality like scheduled tasks. I tried making a module with a single project containing the usual components:
... however it was not recognised as a module when uploaded and Oqtane restarted (no entry under Admin Dashboard > Module Management). The assembly is present in the website, so I can reference it in other modules (as a shared dependency) ... I would just like to see it recognised so I can see what version is installed. Is there a similar concept in Oqtane and how do I achieve it? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 11 replies
-
Can you share your IModuleInfo ? |
Beta Was this translation helpful? Give feedback.
-
I also tried to achieve that and I ended up creating an empty Index.razor with a message like "NOT INTENDED TO USE. ONLY INTERNAL" and set the Categories property of the ModuleDefinition to "Admin" so that it doesn't show up for content managers when adding modules to a page. |
Beta Was this translation helpful? Give feedback.
-
@lanthonyneville currently there is now way to achieve this. The way @mdmontesinos is the way that I have created the install package for the Oqtane Templates. |
Beta Was this translation helpful? Give feedback.
-
@lanthonyneville currently an Oqtane "module" needs to have at least one razor component which implements IModuleControl (ie. via ModuleBase). This is because Oqtane modules are not required to have a ModuleInfo.cs class and because modules are discovered using reflection at startup (ie. the framework inspects assemblies for classes implementing IModuleControl). So the approach suggested by @mdmontesinos is the recommended approach for this scenario - simply include a razor component (or a class which implements IModuleControl). |
Beta Was this translation helpful? Give feedback.
I also tried to achieve that and I ended up creating an empty Index.razor with a message like "NOT INTENDED TO USE. ONLY INTERNAL" and set the Categories property of the ModuleDefinition to "Admin" so that it doesn't show up for content managers when adding modules to a page.