Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Framework.Reflection.CreateObject throwing exception on DataProvider
Previous Previous
 
Next Next
New Post 2/28/2006 12:08 PM
User is offline Glenn Goodrich
6 posts
10th Ranked


Framework.Reflection.CreateObject throwing exception on DataProvider 
Hi,

I am going crazy here, so any help is appreciated.  I have a custom module that throws an exception on this line:

private static void CreateProvider()
        {
            objProvider = ((DataProvider)DotNetNuke.Framework.Reflection.CreateObject("data", "Enspiria.DNN.Modules.RupModule.Data", "Enspiria.DNN.Modules.RupModule"));
        }

The exception is:

DotNetNuke.Services.Exceptions.ModuleLoadException: The type initializer for "Enspiria.DNN.Modules.RupModule.Data.DataProvider" threw an exception. ---> System.TypeInitializationException: The type initializer for "Enspiria.DNN.Modules.RupModule.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 TypeName, String CacheKey) at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectProviderName, String ObjectNamespace, String ObjectAssemblyName) at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectNamespace, String ObjectAssemblyName) at Enspiria.DNN.Modules.RupModule.Data.DataProvider.CreateProvider() in C:\dotnetnuke\DesktopModules\RupModule\Components\DataProvider.cs:line 27 at Enspiria.DNN.Modules.RupModule.Data.DataProvider..cctor() in C:\dotnetnuke\DesktopModules\RupModule\Components\DataProvider.cs:line 21 --- End of inner exception stack trace --- at Enspiria.DNN.Modules.RupModule.Data.DataProvider.Instance() at Enspiria.DNN.Modules.RupModule.Business.RupModuleController.GetByModules(Int32 ModuleId) in c:\dotnetnuke\desktopmodules\rupmodule\components\rupmodulecontroller.cs:line 25 at Enspiria.DNN.Modules.RupModule.RupModule.Page_Load(Object sender, EventArgs e) in c:\dotnetnuke\desktopmodules\rupmodule\rupmodule.ascx.cs:line 51 --- End of inner exception stack trace ---

I have tried just about everything I can think of.  This is my first custom module, so I am literally following the Wrox book step by step, but it doesn't work.  PLEASE HELP!

Thanks,
Ruprict
 
New Post 2/28/2006 1:54 PM
User is offline Glenn Goodrich
6 posts
10th Ranked


Re: Framework.Reflection.CreateObject throwing exception on DataProvider 
More info.....

The exception actually occurs in DotNetNuke.Framework.Reflection in this method:

Public Shared Function CreateObject(ByVal TypeName As String, ByVal CacheKey As String) As Object
 on this line:
 objType = Type.GetType(TypeName, True)

TypeName seems valid to me: "Enspiria.DNN.Modules.RupModule.SqlDataProvider, Enspiria.DNN.Modules.RupModule.SqlDataProvider" which is a class. 

Finally, the actual exception is (and it's a weird one):

 "System.TypeLoadException: ?
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at DotNetNuke.Framework.Reflection.CreateObject(String TypeName, String CacheKey) in C:\dotnetnuke\components\Shared\Reflection.vb:line 90"  

So, there is something wrong with the type name it's deriving, is my guess, but I can't seem to figure out what it is.


 
New Post 2/28/2006 2:11 PM
User is offline Glenn Goodrich
6 posts
10th Ranked


Re: Framework.Reflection.CreateObject throwing exception on DataProvider 
Solved....

My SqlDataProvider class was in a SqlDataProvider namespace, so the type needed to be SqlDataProvider.SqlDataProvider or I needed to remove that part of the namespace, which is what I did.

Real problem: I am not smart.

Sorry to kill forum space.
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Framework.Reflection.CreateObject throwing exception on DataProvider
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


DotNetNuke® in Sweden
All service of DotNetNuke® in Sweden.
Olsmar Konsult
Overlook Technology
Website Development, DotNetNuke Consulting, Module Development, Portal Management
OverlookTechnology.com
DeutschNetNuke = DotNetNuke in German
DeutschNetNuke provides all DotNetNuke related services in German (and English).
www.DeutschNetNuke.de

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP