Hi,
I have just upgraded my site from DNN 3.3.5 to 4.4 including our custom modules from 3.x to 4.x using module upgrade wizard.
When i browse to the custom module, i get the following error after upgrade:
Error: Online Advice Services is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: The type initializer for 'CSeGuidance.DataProvider' threw an exception. ---> System.TypeInitializationException: The type initializer for 'CSeGuidance.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, Boolean UseCache) in C:\Websites\CivvyStreet_source\Library\Components\Framework\Reflection.vb:line 254 at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectProviderName, String ObjectNamespace, String ObjectAssemblyName, Boolean UseCache) in C:\Websites\CivvyStreet_source\Library\Components\Framework\Reflection.vb:line 189 at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectNamespace, String ObjectAssemblyName) in C:\Websites\CivvyStreet_source\Library\Components\Framework\Reflection.vb:line 94 at CSeGuidance.DataProvider.CreateProvider() in C:\Websites\CivvyStreet_source\Website\App_Code\CSeGuidance\DataProvider.vb:line 20 at CSeGuidance.DataProvider..cctor() in C:\Websites\CivvyStreet_source\Website\App_Code\CSeGuidance\DataProvider.vb:line 15 --- End of inner exception stack trace --- at CSeGuidance.DataProvider.Instance() at CSeGuidance.QueryController.GetAllQueries(Int32 UserID) in C:\Websites\CivvyStreet_source\Website\App_Code\CSeGuidance\QueryController.vb:line 31 at CSeGuidance.ViewQueries.FillDataGrid() in C:\Websites\CivvyStreet_source\Website\DesktopModules\CSeGuidance\ViewQueries.ascx.vb:line 65 at CSeGuidance.ViewQueries.Page_Load(Object sender, EventArgs e) in C:\Websites\CivvyStreet_source\Website\DesktopModules\CSeGuidance\ViewQueries.ascx.vb:line 47 --- End of inner exception stack trace ---
I am not sure how much difference does the directory structure in the App_Code makes. The wizard has created the following structure:
App_Code >>> Module Name >>> Providers.......... >>> SqlDataProvider.vb
>>> Code >>> (DataProvider.vb, info, controller classes etc.)
I have tried placing all files under Module Directory under App_Code and also tried placing Providers directory under DesktopModules/Module Name directory but no difference.
Following is my code from data provider which i believe is fine:
#
Region "Shared/Static Methods"
' singleton reference to the instantiated object
Private Shared objProvider As DataProvider = Nothing
' constructor
CreateProvider()
Shared Sub New()End Sub
' dynamically create provider
objProvider =
Private Shared Sub CreateProvider()CType(Framework.Reflection.CreateObject("data", "CSeGuidance", "CSeGuidance"), DataProvider)End Sub
' return the provider
Public Shared Shadows Function Instance() As DataProviderReturn objProviderEnd Function
#
End Region
Any help would be greatly appreciated.
Regards
Arif Shah