2014-04-04 32 views
0

ASP.NET Framework 4.0中和C#物業未找到方法

我有兩個DLL,data.dlladapter.dllAdapter.dll參考data.dll

例如,在data.dll中我有customer.cs實體。我已添加屬性調用Currency_Id和數據類型是GUID不爲空。我用它在adapter.dll。構建整個項目併發布到生產環境。

它工作正常。然後我改變了Currency_Id not null to null。然後建立只有data.dll和發佈只有data.dll。然後我得到了錯誤 - :

2014-04-03 23:40:49,707 [12] DEBUG SPO.ORBIS.Business.Purchasing.ApprovedVendorListController [(null)] – Method not found: 'Void SPO.ORBIS.Data.Purchasing.Dto.VendorBankAccountsDto.set_CurrencyId(System.Guid)'. 
System.MissingMethodException: Method not found: 'Void SPO.ORBIS.Data.Purchasing.Dto.VendorBankAccountsDto.set_CurrencyId(System.Guid)'. 
    at SPO.ORBIS.DataAdapter.Purchasing.ApprovedVendorListRepository.GetVendorBankAccounts(Guid vendorId) 
    at SPO.ORBIS.DataAdapter.Purchasing.ApprovedVendorListRepository.GetVendorDetails(Guid vendorId) 
    at SPO.ORBIS.Business.Purchasing.ApprovedVendorListController.GetVendorDetails(Guid vendorId) 

但是如果我data.dll釋放adapter.dll在一起,這是工作的罰款。但是我們使用msbuild軟件,並且只發布data.dll,因爲它只是data.dll中的更改。

請讓我知道可能是什麼問題?

謝謝。 亞歷

回答

1

編譯代碼Adapter.dll,C#編譯它基於由組件暴露了Adapter.dll引用界面元素。對於Guid類型的屬性,由編譯器生成的setter和getter方法具有非常明確的特徵。當Data.dll中某個類的屬性在Adapter.dll中被引用時,編譯器會調用這些方法。如果將屬性類型更改爲Guid?(可爲空),則Data.dll中此屬性的setter和getter將具有不同的簽名。因此,找不到Adapter.dll調用中的舊方法。

您不能更改其他程序集使用的接口元素,也不能重新部署這些其他程序集。

+0

謝謝你的具體解釋,伊戈爾。 –