データベースからデータを取得するために、MVC プロジェクトとトレーリングに取り組んでいます。この問題は、アプリケーションを実行したときに発生します
例外の詳細: System.TypeLoadException: アセンブリ '~.BI.Production、Version=1.0.0.0、Culture=neutral、PublicKeyToken=null' のタイプ '~BI.Production.ProductionOrderItem' のメソッド 'add_PropertyChanged' には実装がありません。
ASPプロジェクトでテストしても問題ありませんが、MVCでのみ問題が発生しました
ここに私のコントローラ
public class ProdukterController : Controller
{
public ActionResult Index()
{
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConn"].ConnectionString.ToString());
ProductionOrderList produkter = ProductionOrderReg.GetProductionOrders(conn, new Guid("28937bcc-6eaf-4b5a-a789-fadff99403cd"));
ViewData["produkter"] = produkter;
return View();
}
ここに私のビュー、Gridview
protected void Page_Load(object sender, EventArgs e)
{
GridView1.DataSource = ViewData["produkter"];
GridView1.DataBind();
}