You are hereCommunity > Forums
Register   |  Login
 DotNetNuke Forums
Minimize
 
  Forum  General DotNetN...  Extend It! ( Pr...  Error creating new module in DNN 3.2.1 using DNNJungleProjectTemplates
Previous Previous
 
Next Next
New Post 12/31/2005 2:11 PM
User is offline Chevol Davis
22 posts
www.thornburgmortgage.com
10th Ranked


Error creating new module in DNN 3.2.1 using DNNJungleProjectTemplates 

I write the code and complie, everything seems to go smoothly. I then add my module definitions and try to add the module to a page and I get the following error:

ModuleDefId: 121
FriendlyName: StockPrice
ModuleControlSource: DesktopModules/StockPrice/StockPrice.ascx
AssemblyVersion: 03.02.01
Method: System.Activator.CreateInstance
FileName:
FileLineNumber: 0
FileColumnNumber: 0
PortalID: 0
PortalName: XXXX
UserID: 1
UserName: host
ActiveTabID: 72
ActiveTabName: Products & Programs
AbsoluteURL: /thornburg/Default.aspx
AbsoluteURLReferrer: http://xx.xx.xx.xx/thornburg/HomeLoans/ProductsPrograms/tabid/72/Default.aspx
ExceptionGUID: 211482e7-2c74-4a9e-9e82-43db4ecc80c2
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
InnerException: The type initializer for "VerticalCurve.DNN.Modules.StockPrice.Data.DataProvider" threw an exception.
Message: DotNetNuke.Services.Exceptions.ModuleLoadException: The type initializer for "VerticalCurve.DNN.Modules.StockPrice.Data.DataProvider" threw an exception. ---> System.TypeInitializationException: The type initializer for "VerticalCurve.DNN.Modules.StockPrice.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) in C:\thornburg\components\Shared\Reflection.vb:line 99 at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectProviderName, String ObjectNamespace, String ObjectAssemblyName) in C:\thornburg\components\Shared\Reflection.vb:line 71 at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectNamespace, String ObjectAssemblyName) in C:\thornburg\components\Shared\Reflection.vb:line 45 at VerticalCurve.DNN.Modules.StockPrice.Data.DataProvider.CreateProvider() in C:\thornburg\DesktopModules\StockPrice\Components\DataProvider.cs:line 27 at VerticalCurve.DNN.Modules.StockPrice.Data.DataProvider..cctor() in C:\thornburg\DesktopModules\StockPrice\Components\DataProvider.cs:line 21 --- End of inner exception stack trace --- at VerticalCurve.DNN.Modules.StockPrice.Data.DataProvider.Instance() at VerticalCurve.DNN.Modules.StockPrice.Business.StockPriceController.GetByModules(Int32 ModuleId) in C:\thornburg\DesktopModules\StockPrice\Components\StockPriceController.cs:line 26 at VerticalCurve.DNN.Modules.StockPrice.StockPrice.Page_Load(Object sender, EventArgs e) in c:\thornburg\desktopmodules\stockprice\stockprice.ascx.cs:line 51 --- End of inner exception stack trace ---
StackTrace:
Source:
Server Name: XXXX

I have looked around forever and cannot find a solution. Any help will be much appreciated.


What would life be if we had no courage to attempt anything? --Vincent Van Gogh
 
New Post 1/1/2006 7:53 AM
User is offline Steve Webster
1 posts
10th Ranked


Re: Error creating new module in DNN 3.2.1 using DNNJungleProjectTemplates 

I suspect you are having the same problem I had with this -  Inside of the Dataprovider.vb file in the CreateProvider sub procedure, you create an instance of your specific dataprovider - the first argument should be "data" and the second should match the namespace you use in your SQLDataProvider.vb file, the third should match the assembly name of the assembly that your SQLDataProvider.vb file is in.  Also check to be sure that your SQLDataProvider project, in my case DotNetWebster.Modules.Thumbviewer has the Root namespace blanked out.  Get to that via the property page for the SQLDataProvider project.  This CreateProvider method error can drive you insane - I know it nearly did for me - because it uses reflection it will compile even though it won't work.  The CreateObject thing is a DNN wrapper for the actual reflection going on under the hood - I started glazing over trying to figure out what that is doing.  I think it is essentially creating a specific dataprovider like SQLServer and casting it into the generic contract for DataProvider.  It is cool in theory but can be very frustrating in practice.

' dynamically create provider

Private Shared Sub CreateProvider()

objProvider = CType(Framework.Reflection.CreateObject("data", "DotNetWebster.Modules.Thumbviewer.Data", "DotNetWebster.Modules.Thumbviewer"), DataProvider)

End Sub

 
New Post 1/2/2006 5:58 AM
User is offline Vicenç Masanas
1397 posts
www.disgrafic.com
6th Ranked








Re: Error creating new module in DNN 3.2.1 using DNNJungleProjectTemplates 
You should have done something different on your customization that make the default template behaviour fail.
A couple of things to check:
- namespaces: if the module namespace is Company.DNN.Modules.ModuleName the dataprovider should be Company.DNN.Modules.ModuleName.Data.
- assembly names: Company.DNN.Modules.ModuleName for the module and Company.DNN.Modules.ModuleName.SqlDataProvider
- assemblies in \bin folder: my templates assume you're using the BuildProject to copy both assemblies to the bin folder so make sure this is true. Check that the BuildSupport project references both of your projects: module and data provider.
- and finally take a look at my hello world tutorial and try to figure what you did different that could broke it.

Disgrafic.com
 
New Post 1/3/2006 5:25 AM
User is offline Chevol Davis
22 posts
www.thornburgmortgage.com
10th Ranked


Re: Error creating new module in DNN 3.2.1 using DNNJungleProjectTemplates 
The namespaces and assembly names are all correct. I alieviated the problem by commenting out the lines that were giving me a problem. Note I was not connecting to a datasource at all, could this have been my problem? Also the templates are for 3.0 I know a lot has changed.
What would life be if we had no courage to attempt anything? --Vincent Van Gogh
 
New Post 1/3/2006 9:41 AM
User is offline Vicenç Masanas
1397 posts
www.disgrafic.com
6th Ranked








Re: Error creating new module in DNN 3.2.1 using DNNJungleProjectTemplates 
Not sure what are you doing here but this line:
InnerException: The type initializer for "VerticalCurve.DNN.Modules.StockPrice.Data.DataProvider" threw an exception.

just tells that your code is invoking the data provider. So check it again because somewhere you have a call that tries to connect to the db.

Disgrafic.com
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Error creating new module in DNN 3.2.1 using DNNJungleProjectTemplates
 Forum Policy
Minimize

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.

 Need Help?
Minimize
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 Ads
Minimize
Biz Modules provides professional business modules and solutions for DotNetNuke
 Sponsors
Minimize