zoukankan      html  css  js  c++  java
  • 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文件解决问题。
  • 相关阅读:
    Hibernate初级
    Servlet, Listener 、 Filter.
    DBCP数据源
    数据库连接池
    MySQL入门笔记
    20170330 webservice代理类测试
    20170330 ABAP代理生成
    20170329 隐士增强问题
    ABAP rfc 发布webservice 错误
    ABAP 性能优化001
  • 原文地址:https://www.cnblogs.com/DotNetNuke/p/1229238.html
Copyright © 2011-2022 走看看