DNN 4.0 loads Provider classes with case-sensitive names.

I've rebuild ''DotNetNuke.Modules.Html.SqlDataProvider'.DLL' from the downloaded source code and started to receive errors: 

System.TypeLoadException: Could not load type ''DotNetNuke.Modules.Html.SqlDataProvider'' from assembly ''DotNetNuke.Modules.Html.SqlDataProvider''.
   at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
   at System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
   at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
   at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
   at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError)
   at DotNetNuke.Framework.Reflection.CreateObject(String TypeName, String CacheKey, Boolean UseCache) in C:\Projects\DNNLibrary\Components\Shared\Reflection.vb:line 241

After investigation I noticed that caller specify provider namespace as ''DotNetNuke.Modules.Html", but the actual namespace in SqlDataProvider'.vb is ''DotNetNuke.Modules.HTML".

Because current code in DotNetNuke.Framework.Reflection.CreateObject loads case-sensitive names, the error occured.

It will be bettter to change core code to use BuildManager.GetType overload that ignores case.

objType = BuildManager.GetType(TypeName, True, True)

I've reported a bug in DNN support. Update: It will be fixed in DNN 4.1

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted @ Wednesday, February 15, 2006 12:32 PM
Print

Comments on this entry:

# re: DNN 4.0 loads Provider classes with case-sensitive names.

Left by Michael Freidgeim at 2/19/2006 7:30 PM
Gravatar
Hi Chen,
Sorry, but I am not an expert in DNN.
I beleive that in DNN 4 it is still quite valid to create separate DLLs for DataProvider and SqlDataProvider. In this case you will have full control under assembly name( but will be less convinient debugging,because edit and continue will not work for loaded DLLs).
>>2) Why do these modules work when we actually run them, but not under unit testing? >>Do the modules get instantiated differently?
As I understand, ASP.NET runtime is searching bin folder for assemblies, that have requested to load classes. Unit test framework probably not as smart.
If you are using VSTS for unit testing, this link can be useful for you.

# re: DNN 4.0 loads Provider classes with case-sensitive names.

Left by Michael Freidgeim at 2/19/2006 7:36 PM
Gravatar
Visual Studio Team System
How to: Create an ASP.NET Unit Test : http://msdn2.microsoft.com/en-us/library/ms182526.aspx .

Your comment:



(not displayed)


 
 
 
 
 

Live Comment Preview:

 
«February»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910