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文件解决问题。
  • 相关阅读:
    POJ 3373 Changing Digits 记忆化搜索
    POJ 3268 Silver Cow Party (Dijkstra + 优先队列)
    ZOJ 1232 Adventure of Super Mario (Floyd + DP)
    POJ 2406 Power Strings KMP算法之next数组的应用
    POJ 1961 Period KMP算法之next数组的应用
    POJ 2492 A Bug's Life 并查集的应用
    POJ 1703 Find them, Catch them 并查集的应用
    POJ 3321 Apple Tree 树状数组+DFS
    POJ 3368 Frequent values 线段树与RMQ解法
    POJ 3264 Balanced Lineup RMQ ST算法
  • 原文地址:https://www.cnblogs.com/DotNetNuke/p/1229238.html
Copyright © 2011-2022 走看看