.RegisterResource<CustomModule>(), in the initialize method as stated in this thread.
So, my question is how do resources get loaded on a web app restart. Because, I have a breakpoint set in a static constructor for my custom module and that break point never gets hit. The exception is thrown before it hits my breakpoint. Any help is appreciated.
void InstallCustomVirtualPaths(SiteInitializer initialzer)
virtualPathConfig = initialzer.Context.GetConfig<VirtualPathSettingsConfig>();
var questionTemplatesModuleVirtualPathConfig = new VirtualPathElement(virtualPathConfig.VirtualPaths)
VirtualPath = Jobs
Module.VirtualPath + "*",
if (!virtualPathConfig.VirtualPaths.ContainsKey(QuestionTemplatesModule.VirtualPath + "*"))
override void Install(SiteInitializer initializer)
The tables may differ in your specific case. But if you start by trying to erase your reference from the sf_page_node, then your database will tell you the tables you need to have references removed from before it finally lets you remove the record.
In any case, I did not realize an exception was being thrown and I finally happened to get wind of it when I was debugging the app. The exception did not get displayed in the browser, I just realized it when I was stepping through the code. Any time an exception is thrown while Sitefinty is constructing the menu items for your custom module, this error will occur. I guess some required code does not get executed and it leaves the application in an unstable state. When I correct the error, the top menu of my custom module got displayed but when I click on the top menu, the same exception occurred again. Once again, I had an exception being thrown on the construction of my child page. When I corrected the error, everything worked fine. So, there are silent errors that are being thrown and caught somewhere in the application that prevent required code dealing with the custom Resource file of your custom module from being executed. I hope this helps.
I see no particular error in the code everyone has provided that may cause the described issue. What I think gets messed up in most of the cases are assembly references.
In Ancuta Me's description, you add a reference to the module's assembly by copying the DLL to the BIN folder. I would recommend that you include both projects in the same solution and add a project reference in the website (or web application) to the module's project. This ensures that whatever changes you make, the website and the module stay in sync. This is also what we have done in the SDK sample and it works fine there. Could you all try this and see if it resolves the issue?
@Bobby Williams, I would not recommend you manually delete stuff from the database to remove a module. This can have unforeseen side effects. It is true that we don't have any way to uninstall a module. Rather I think you should all work in a development environment (with a temporary database), until you resolve any issues with your custom modul,e and are sure that installation goes smoothly. Then you can install a module on a live DB.
As a rule, the system calls the module's Install() method whenever the version for this module in SystemConfig.config is blank. If you want to re-install, just edit that file and remove the version attribute for your module. This will not reverse database changes, though.