Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Type Initialization Exception (not caused by upgrade)?Type Initialization Exception (not caused by upgrade)?
Previous
 
Next
New Post
9/24/2007 2:47 PM
 

Type Initialization Exception

 

Hi All

I am testing a module in 4.5.5 called "Interface". It works fine and I am trying to package it.

I have compiled the .vb files (using the command line compiler) and added the .dlls to the .dnn install file.

Everything seemed OK (files in the right place when I upload) but I now get this message...

Error: Interface is currently unavailable.

DotNetNuke.Services.Exceptions.ModuleLoadException: The type initializer for 'MheLtd.Modules.Interface.DataProvider' threw an exception. ---> System.TypeInitializationException: The type initializer for 'MheLtd.Modules.Interface.DataProvider' threw an exception. ---> System.ArgumentNullException: Value cannot be null. Parameter name: type at System.Activator.CreateInstance(Type type, Boolean nonPublic) at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectProviderName, String ObjectNamespace, String ObjectAssemblyName, Boolean UseCache) at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectNamespace, String ObjectAssemblyName) at MheLtd.Modules.Interface.DataProvider.CreateProvider() at MheLtd.Modules.Interface.DataProvider..cctor() --- End of inner exception stack trace --- at MheLtd.Modules.Interface.DataProvider.Instance() at MheLtd.Modules.Interface.InterfaceController.GetInterfaces(Int32 PortalId) at MheLtd.Modules.Interface.ListInterface.Page_Load(Object sender, EventArgs e) --- End

of inner exception stack trace ---

I have seen Michael Washington’s advice that this might be caused by upgrading a module from DNN3 to DNN4 and to change

CType(Framework.Reflection.CreateObject("data", "MyModule", "MyModule.dll"), DataProvider)

To:

CType(Framework.Reflection.CreateObject("data", "MyModule", ""), DataProvider)

But my code already says

' dynamically create provider

Private Shared Sub CreateProvider()

objProvider = CType(Framework.Reflection.CreateObject("data", "MheLtd.Modules.Interface", ""), DataProvider)

End Sub

 

So does anyone have any thoughts on what to do next?

Kind regards

Geoffrey

 


Geoffrey Morton-Haworth www.yalaworld.net
 
New Post
1/5/2008 9:57 AM
 

Feedback from me, since no one replied to this question.

For anyone encountering this, or similar problems,  the command line compiler is good enough for very simple modules - but why bother to compile  when your  compiled code can be so easily disassembled? The problems came when I had embedded UserControls in aspx pages.

So I shelled out for Visual Studio and followed Vladan Strigo's approach here.

This did the trick.

Good luck

Geoffrey

 


Geoffrey Morton-Haworth www.yalaworld.net
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Type Initialization Exception (not caused by upgrade)?Type Initialization Exception (not caused by upgrade)?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out