Forum


HomeHomePremiumPremiumDevelopmentDevelopmentOdd DAL problem, null exception...Odd DAL problem, null exception...
Previous
 
Next
New Post
4/28/2014 12:50 PM
 

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?

 

 

 
New Post
4/29/2014 4:32 AM
 

Hi Keith,

Not sure if I follow you in terms of the conversion you are trying to do, but if you want, send me the code and I can try it out whenever I have a chance.

Maybe it will become clear once I see the full code.

You can send to my email aderson at dnnhero dot com

Cheers,

Aderson

 
New Post
4/29/2014 4:59 AM
 

Keith,

Does your ContactTypeInfo entity object implement IHydratable?  If so, does it enter the Fill() event in that object?

 
New Post
4/29/2014 5:57 AM
 

Thanks for the comments, but I've figured out the problem. When I restructured my templates to generate the "DNN7 way" I moved the info elements to the Entities namespace, the controller elements to the Components namespace, and the data provider elements to the Data namespace. I also eliminated the separate project for the concrete data provider.

Unfortunately when I did that I forgot to change the namespace that's passed to the framework at the top of the data provider. That's why it never hit any breakpoints in the sqldataprovider, it was never created because it couldn't find it.

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentOdd DAL problem, null exception...Odd DAL problem, null exception...



Try FREE
30 days money back guaranteed