Hi Guys,
A big thanks to all of you for your support.
I upgraded my portal to the latest version and downloaded the DNN source built it and then used my built DNN assemblies to attempt to debug the problem. Caused my some problem to get it going, but I finally found my problem.
The 5th parameter of the CreatePortal call contains the location of the template, and the 6th parameter contains the template filename.At line 1260 of PortalController.cs there is a call to the ParseTemplate method to build the site from the template. Line 1664 of PortalController.cs calls
xmlPortal.Load(TemplatePath + TemplateFile);
but the problem is the it just append the path and filename without checking for a trailing
/
on the path parameter.
A bigger issue is that the procedure traps the exception and writes to a Log4Net error log, which by default installation is not configured, thus the exception is never recorded.
The code continues only to line 1281 of PortalController.cs and creates a new instance of the PortalSettings object using the constructor at line 147 of PortalSettings.cs. This calls GetPortalSettings which in turn calls VerifyPortalTab to verify that the basic tabs/page of the new portal exist which in turn calls the VerifySpecialTab method which sets the ActiveTab object mention above.
We continue the GetPortalSettings method of PortalController.cs to line 1047
foreach (ModuleInfo module in ActiveTab.Modules)
which crashes because the Modules property of out ActiveTab object contain a NULL value.
Hence, Object reference not set.
I believe the guys in DNN code should use the System.IO.Path.Combine function to properly concatenate the 2 value into a proper filename and save everyone this hassle.
Again, many thanks to all for their input.