- Create a standard .NET class library containing utility classes (for example, a POCO model or an Html Helper extension method)
- Add this as a file based reference to an Orchard Module and
- Use a class from this reference dll in a razor view (for example, in a part view for a widget).
@Html.NamedValidationSummary("logon", T("Login was unsuccessful. Please correct the errors and try again.").ToString())
- Package this module (confirming that the reference .dll was included correctly in the bin folder of the modules content)
- Deploy this module to a fresh Orchard installation
- Confirm that you see the reference dll in the app_data\dependencies folder in your new installation
- Attempt to call the page using the razor view. You receive an error
"Compiler Error Message: CS0234: The type or namespace name 'xxxxxx' does not exist in the namespace 'xxxxxx' (are you missing an assembly reference?)
The workaround is to drop the dll into the root bin folder of the orchard installation.
Orchard should find the reference dll in the dependencies folder when compiling razor views.