I'm still working to convert my code generation templates to DNN7 and struggling through the VB conversion. (I'm doing VB first because it was more complete than my C# version). I'm working to follow the christoc "format" as far as folder and module structure, and upgrade all the interfaces to DNN7. To start though, I just want to get everything restructured but still using DAL as DAL2 has been somewhat of a non-starter for me on functionality.
I can't seem to get anything to work in the DAL in VB. I've gotten past the various model-non-loading errors by making sure to generate all the designers and fix some namespace errors, but I'm at a loss on this error:
DotNetNuke.Services.Exceptions.PageLoadException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'Crewstone.Modules.Race2012VB.Data.DataProvider' threw an exception. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: type
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectProviderName, String ObjectNamespace, String ObjectAssemblyName, Boolean UseCache, Boolean fixAssemblyName)
at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectNamespace, String ObjectAssemblyName)
at Crewstone.Modules.Race2012VB.Data.DataProvider.CreateProvider() in C:\Users\Keith Stone.CREWSTONE\Documents\My Web Sites\DNN720\DesktopModules\Race2012VB\Data\DataProvider.vb:line 43
at Crewstone.Modules.Race2012VB.Data.DataProvider..cctor() in C:\Users\Keith Stone.CREWSTONE\Documents\My Web Sites\DNN720\DesktopModules\Race2012VB\Data\DataProvider.vb:line 38
--- End of inner exception stack trace ---
at Crewstone.Modules.Race2012VB.Components.FeatureController.ListContactTypes(Int32 portalId) in C:\Users\Keith Stone.CREWSTONE\Documents\My Web Sites\DNN720\DesktopModules\Race2012VB\Components\FeatureController.vb:line 73
The statement it punts on is:
<DataObjectMethod(DataObjectMethodType.Select)> _
Public Function ListContactTypes(ByVal portalId As Integer) As List(Of ContactTypeInfo)
Return CBO.FillCollection(Of ContactTypeInfo)(Data.Dataprovider.Instance().ListContactTypes(portalId))
End Function
I've checked the stored procedure and it works, but it looks like it never actually hits the dataprovider or SQLdataprovider. I don't see any breakpoints being hit there at all.
Anyone got any great ideas?