System.InvalidCastException: Unable to cast object of type SqlDataProvider to type DataProvider

Error: Edit Content is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: The type initializer for 'M2Land.Modules.FlashImageRotator.DataProvider' threw an exception. ---> System.TypeInitializationException: The type initializer for 'M2Land.Modules.FlashImageRotator.DataProvider' threw an exception. ---> System.InvalidCastException: Unable to cast object of type 'M2Land.Modules.FlashImageRotator.SqlDataProvider' to type 'M2Land.Modules.FlashImageRotator.DataProvider'. at M2Land.Modules.FlashImageRotator.DataProvider.CreateProvider() in E:"Development"DotNetNuke"InstallArea"DotNetNuke_04.08.03_Source"Website"DesktopModules"M2Land.FlashImageRotator"Provider"DataProvider"SqlDataProvider"DataProvider.cs:line 55 at M2Land.Modules.FlashImageRotator.DataProvider..cctor() in E:"Development"DotNetNuke"InstallArea"DotNetNuke_04.08.03_Source"Website"DesktopModules"M2Land.FlashImageRotator"Provider"DataProvider"SqlDataProvider"DataProvider.cs:line 49 --- End of inner exception stack trace --- at M2Land.Modules.FlashImageRotator.DataProvider.Instance() at M2Land.Modules.FlashImageRotator.FlashImageRotatorController.GetFlashImageRotator(Int32 ModuleId) in E:"Development"DotNetNuke"InstallArea"DotNetNuke_04.08.03_Source"Website"DesktopModules"M2Land.FlashImageRotator"Provider"DataProvider"SqlDataProvider"FlashImageShowController.cs:line 111 at M2Land.Modules.FlashImageRotator.EditFlashImageRotator.Page_Load(Object sender, EventArgs e) in E:"Development"DotNetNuke"InstallArea"DotNetNuke_04.08.03_Source"Website"DesktopModules"M2Land.FlashImageRotator"EditFlashImageRotator.ascx.cs:line 68 --- End of inner exception stack trace ---

原因是这个项目是从StartKit迁移过来的,在App_Code下有同名的DataProvider和SqlDataProvider文件,所以反射时得到的类型不匹配。

删除App_Code中同名DataProvider和SqlDataProvider文件解决问题。

posted on 2008-06-24 23:01  m2land  阅读(2182)  评论(0编辑  收藏  举报

导航