0
除了我的Web應用程序項目之外,我的解決方案中還有一個BLL和DAL項目。我正在使用實體框架5,並且我在DAL項目中有.tt文件。一切工作正常,但後來我試圖分離.tt文件到基於this鏈接的新項目「實體」。無法在分離POCO類後從BLL引用DAL項目
實體和DAL項目生成良好。但是對於我的BLL中具有「使用DAL」的所有類,我有一個新錯誤「無法找到DAL的類型或名稱空間」。我嘗試清理所有解決方案並重新整理它們,我也嘗試從BLL項目中刪除DAL引用並讀取它,但仍然出現相同的錯誤。
什麼可能導致此問題?我可以添加哪些更多信息來幫助找出問題所在?
編輯:
這裏有一個生成的POCO類
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Entities
{
using System;
using System.Collections.Generic;
public partial class tblsource_type
{
public tblsource_type()
{
this.tbltitles = new HashSet<tbltitle>();
}
public int Source_Type_Id { get; set; }
public string Source_Type_Name { get; set; }
public virtual ICollection<tbltitle> tbltitles { get; set; }
}
}
你檢查了構建順序和依賴關係嗎?這些類是否生成併成爲DAL項目的一部分? – Jaster
你能告訴我們你的DAL dll類是怎麼樣的嗎?包括命名空間 – Juan
您是否確定新項目使用相同的.NET版本? –