C#.NET無效轉換異常:C#.NET無效轉換異常
[A] GroupReference不能轉換爲[B] GroupReference。類型A 源自'App_Code.d7jdf1ji,版本= 0.0.0.0,文化=中性, PublicKeyToken = null'在位置 'C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Temporary ASP.NET Files \ root \ 26676eb7 \ 92c7e946 \ App_Code.d7jdf1ji.dll'。類型B在位置 'C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \'上下文'默認'中從'App_Code.t8v3riip,版本= 0.0.0.0,Culture = neutral, PublicKeyToken = null'發起 。臨時ASP.NET 文件\ ROOT \ 26676eb7 \ 92c7e946 \ App_Code.t8v3riip.dll」
這裏是我的代碼
public partial class packages : System.Web.UI.Page
{
GroupReference gr_object;
DataConnect dc_object;
protected void Page_Load(object sender, EventArgs e)
{
gr_object = (GroupReference)Session["GroupReference"];
dc_object = (DataConnect)Session["DataConnect"];
if (!IsPostBack)
{
Page.EnableViewState = false;
Welcome.Text = "packages end date is the day it is requested.<br/><br/>";
Data.init();
HideControls();
packages();
packagess_Grid_Active.Visible = true;
packages_Grid_Inactive.Visible = true;
SaveAsExcelButton_Active.Visible = true;
SaveAsExcelButton_Inactive.Visible = true;
ShowControls();
Usage.RecordUse("packages");
}
}
protected void packages()
{
OracleConnection oc = dc_object.oc_object.Connect();
OracleCommand ocmd = new OracleCommand();
OracleDataReader dr;
ocmd.Connection = oc;
ocmd.CommandText = "SELECT * from packages";
ocmd.CommandType = CommandType.Text;
dr = ocmd.ExecuteReader();
是什麼問題? – leAthlon
我想說,你有一個類在2個不同的程序集碰巧具有相同的名稱,但實際上是2個不同的類,因爲他們在2個不同的程序集 – RadioSpace
http://stackoverflow.com/questions/30267116/debugging-在視覺工作室2013-with-duplicated-dll/30267269#30267269 –