PDA

View Full Version : سوال: خطایی عجیب در حالت سه لایه ؟



Fartaj
یک شنبه 22 مرداد 1391, 16:50 عصر
سلام خدمت دوستان

من یک کتابخانه الکترونیک سه لایه درست کرده بودم اما حالا به جدول کتاب چند تا فیلد دیگه اضافه کردم و اومدم تو لایه هام اضافه کردم اما فیلدهای جدید رو تو صفحاتم هم پیدا می کنه هم می گه ناشناسه



Error 31 'BLL.book' does not contain a definition for 'Interpreter' and no extension method 'Interpreter' accepting a first argument of type 'BLL.book' could be found (are you missing a using directive or an assembly reference?) E:\Programming\WEB\ASP\Diglibrary\DIGlibrary\admin \book.aspx.cs 45 38 DIGlibrary



مثلا تو صفحه می زنم : BLL.book.name
تشخیص می ده که هست ولی بازم ارور می گیره چند بار rebuild کردم اما نشد ؟

متد ها رو به این صورت تعریف کردم تو BLL :


public class book
{
public int bookid { get; set; }
public string title { get; set; }
public string b_name { get; set; }
public string w_name { get; set; }
public string Interpreter { get; set; }
public string Publisher { get; set; }
public string p_date { get; set; }
public int pages { get; set; }
public string descrip { get; set; }
public string b_img { get; set; }
public string List { get; set; }
public string b_file { get; set; }
public string createdate { get; set; }


حتی به خاطر این قضیه یک بار هر چی تغییر داده بودم بی خیال شدم دوباره رفتم رو بک آپ پروژه کار کردن :متعجب:

h_r_sh
یک شنبه 22 مرداد 1391, 21:17 عصر
بعد از اینکه build کردی، میشه output رو به صورت کامل بذاری؟

Fartaj
یک شنبه 22 مرداد 1391, 21:44 عصر
خروجی بعد از build :




------ Skipped Rebuild All: Project: DAL, Configuration: Debug Any CPU ------
Project not selected to build for this solution configuration
------ Skipped Rebuild All: Project: BLL, Configuration: Debug Any CPU ------
Project not selected to build for this solution configuration
------ Rebuild All started: Project: DIGlibrary, Configuration: Debug Any CPU ------
E:\Programming\WEB\ASP\Diglibrary\DIGlibrary\admin \book.aspx.cs(45,38): error CS1061: 'BLL.book' does not contain a definition for 'Interpreter' and no extension method 'Interpreter' accepting a first argument of type 'BLL.book' could be found (are you missing a using directive or an assembly reference?)
E:\Programming\WEB\ASP\Diglibrary\DIGlibrary\admin \book.aspx.cs(46,38): error CS1061: 'BLL.book' does not contain a definition for 'Publisher' and no extension method 'Publisher' accepting a first argument of type 'BLL.book' could be found (are you missing a using directive or an assembly reference?)
E:\Programming\WEB\ASP\Diglibrary\DIGlibrary\admin \book.aspx.cs(121,34): error CS1501: No overload for method 'Addbook' takes 12 arguments
E:\Programming\WEB\ASP\Diglibrary\DIGlibrary\admin \book.aspx.cs(138,34): error CS1501: No overload for method 'Addbook' takes 12 arguments
E:\Programming\WEB\ASP\Diglibrary\DIGlibrary\admin \book.aspx.cs(165,34): error CS1061: 'BLL.book' does not contain a definition for 'List' and no extension method 'List' accepting a first argument of type 'BLL.book' could be found (are you missing a using directive or an assembly reference?)
E:\Programming\WEB\ASP\Diglibrary\DIGlibrary\admin \book.aspx.cs(212,26): error CS1501: No overload for method 'Updatebook' takes 13 arguments

Compile complete -- 6 errors, 0 warnings
========== Rebuild All: 0 succeeded, 1 failed, 2 skipped ==========

p.parsaee
یک شنبه 22 مرداد 1391, 23:10 عصر
توي پروژه هاي solution، رفرنس ها رو اضافه كردي؟ اين كارو يه بار ديگه انجام بده شايد درست شد.

مثلا لايه ui بايد يه رفرنس به لايه bll داشته باشه

h_r_sh
یک شنبه 22 مرداد 1391, 23:31 عصر
خروجی بعد از build :




------ Skipped Rebuild All: Project: DAL, Configuration: Debug Any CPU ------
Project not selected to build for this solution configuration
------ Skipped Rebuild All: Project: BLL, Configuration: Debug Any CPU ------
Project not selected to build for this solution configuration
------ Rebuild All started: Project: DIGlibrary, Configuration: Debug Any CPU ------
E:\Programming\WEB\ASP\Diglibrary\DIGlibrary\admin \book.aspx.cs(45,38): error CS1061: 'BLL.book' does not contain a definition for 'Interpreter' and no extension method 'Interpreter' accepting a first argument of type 'BLL.book' could be found (are you missing a using directive or an assembly reference?)
E:\Programming\WEB\ASP\Diglibrary\DIGlibrary\admin \book.aspx.cs(46,38): error CS1061: 'BLL.book' does not contain a definition for 'Publisher' and no extension method 'Publisher' accepting a first argument of type 'BLL.book' could be found (are you missing a using directive or an assembly reference?)
E:\Programming\WEB\ASP\Diglibrary\DIGlibrary\admin \book.aspx.cs(121,34): error CS1501: No overload for method 'Addbook' takes 12 arguments
E:\Programming\WEB\ASP\Diglibrary\DIGlibrary\admin \book.aspx.cs(138,34): error CS1501: No overload for method 'Addbook' takes 12 arguments
E:\Programming\WEB\ASP\Diglibrary\DIGlibrary\admin \book.aspx.cs(165,34): error CS1061: 'BLL.book' does not contain a definition for 'List' and no extension method 'List' accepting a first argument of type 'BLL.book' could be found (are you missing a using directive or an assembly reference?)
E:\Programming\WEB\ASP\Diglibrary\DIGlibrary\admin \book.aspx.cs(212,26): error CS1501: No overload for method 'Updatebook' takes 13 arguments

Compile complete -- 6 errors, 0 warnings
========== Rebuild All: 0 succeeded, 1 failed, 2 skipped ==========


چرا پروژه های DAL و BLL برای build انتخاب نشده اند؟
اول چک کنید که در قسمت Properties در هر پروژه، مقدار TargetFramework ها یکسان باشند. اگر از Framework4 استفاده می کنید، کنترل کنید که مقدار TargetFrameWork برابر NetFrameWork4 Client Profile نباشد. بعد از اینکه این کار را در تمام پروژه هایتان انجام دادید، بر روی ریشه solution راست کلیک کنید و گزینه RebuildAll را انتخاب کنید.
امیدوارم مشکلتان حل شود. :)

Fartaj
یک شنبه 22 مرداد 1391, 23:33 عصر
آره رفرنس دادم چند بار این کار رو کردم آخه جالبیش اینجاست که تنها متدهای جدید رو قبول نداره با قبلی ها مشکلی نداره

منم تو اضافه کردن متدها مثل قبلی ها عمل کردم در حال حاضر لایه ها رو می شناسه منتها با متدهای جدید مشکل داره
سیستم سه لایه رو رو یک پروژه دیگه هم دارم به مرور هم دارم آپدیت می کنم اما به همچین چیز پیله ای بر نخوردم

Fartaj
دوشنبه 23 مرداد 1391, 00:03 صبح
جالبه لایه ها رو جدا جدا rebuild کردم درست شد ، اینطوریش رو دیگه تجربه نکرده بودم تا حالا فکر می کردم کل sulotion رو باید rebuild کنم
در کل ممنون از پی گیریتون