First, I'm a DNN noob.
Dev System: WinXP Pro (SP2), SQL 2000 Dev. Edition, .Net 1.1, VS2003, DNN 3.2.2 w/ Source
DotNetNuke.Core solution builds fine.
I've created a module based on the .Core solution and it also builds fine. When I add the module to a page, I get the following Exception:
Error: My Module Title is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: The type initializer for "MyCompany.DNN.Modules.MyModuleName.Data.DataProvider" threw an exception. ---> System.TypeInitializationException: The type initializer for "MyCompany.DNN.Modules.MyModuleName.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:\Inetpub\wwwroot\DotNetNuke\components\Shared\Reflection.vb:line 99 at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectProviderName, String ObjectNamespace, String ObjectAssemblyName) in C:\Inetpub\wwwroot\DotNetNuke\components\Shared\Reflection.vb:line 71 at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectNamespace, String ObjectAssemblyName) in C:\Inetpub\wwwroot\DotNetNuke\components\Shared\Reflection.vb:line 45 at MyCompany.DNN.Modules.MyModuleName.Data.DataProvider.CreateProvider() in C:\Inetpub\wwwroot\DotNetNuke\DesktopModules\MyModuleName\Components\DataProvider.vb:line 20 at MyCompany.DNN.Modules.MyModuleName.Data.DataProvider..cctor() in C:\Inetpub\wwwroot\DotNetNuke\DesktopModules\MyModuleName\Components\DataProvider.vb:line 15 --- End of inner exception stack trace --- at MyCompany.DNN.Modules.MyModuleName.Data.DataProvider.Instance() at MyCompany.DNN.Modules.MyModuleName.Business.MyModuleNameController.QRYByz_DNN_Modules(Int32 moduleID) in C:\Inetpub\wwwroot\DotNetNuke\DesktopModules\MyModuleName\Components\MyModuleNameController.vb:line 27 at MyCompany.DNN.Modules.MyModuleName.MyModuleName.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\DotNetNuke\DesktopModules\MyModuleName\MyModuleName.ascx.vb:line 24 --- End of inner exception stack trace ---
Other useful info:
MyCompany.MyModuleName.dll is being built in the DesktopModules\MyModuleName\bin directory
MyCompany.MyModuleName.SqlDataProvider.dll is being built in the DesktopModules\MyModuleName\Providers\SqlDataProvider\bin directory
When I Step through in Debug mode, here is the call that leads to the exception:
DesktopModules\MyModuleName\Components\DataProvider.vb:
objProvider = CType(Framework.Reflection.CreateObject("data","MyCompany.DNN.Modules.MyModuleName.Data", "MyCompany.DNN.Modules.MyModuleName"),DataProvider)
That function call eventually reaches into the DotNetNuke\Components\Shared\Reflection.vb file to the following line:
' use reflection to get the type of the class
objType = Type.GetType(TypeName, True)
This is the line actually triggers the exception. The message is:
"File or assembly name MyCompanyName.DNN.Modules.MyModuleName.SqlDataProvider, or one of its dependencies, was not found."
All of the DataProvider code was created using CodeSmith. Thanks for your suggestions!