顯示具有 Entlib 標籤的文章。 顯示所有文章
顯示具有 Entlib 標籤的文章。 顯示所有文章

2013年12月13日 星期五

[除錯] entilb DAAB [The type Database cannot be constructed. You must configure the container to supply this value]

 問題:
The type Database cannot be constructed. You must configure the container to supply this value.

Activation error occured while trying to get instance of type Database, key "ExpSys.Properties.Settings.ConnSqlStr"

解決:
組件[YC_ExpSys.exe]
設定檔[YC_ExpSys.exe.config]

當組件在組件[DayCensorWinApp.exe]上運行時
設定檔[DayCensorWinApp.exe.config]需新增設定檔[YC_ExpSys.exe.config]的設定資料
因為是由[DayCensorWinApp.exe]開啟[YC_ExpSys.exe]
而其設定檔是讀[DayCensorWinApp.exe.config]

環境:
entlib 5.0
vs2010
.net 3.5 sp1

參考:
The type Database cannot be constructed. You must configure the container to supply this value.
The type Database cannot be constructed. You must configure the container to supply this value (EntLib 5 + ODP.NET)
Activation error occured while trying to get instance of type Database, key "cnx"
Activation error occured while trying to get instance of type Database, key “” <— blank
Enterprise Library 5 with ODP.NET

2013年9月22日 星期日

[除錯] Entlib 5.0 DAAB 因相依性問題,而無法解析組件。

當在使用DAAB (Data Access Application Block) 時, compile 出現Error :
無法解析所參考的組件 "Microsoft.Practices.EnterpriseLibrary.Data.SqlCe, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL",因為它在 "System.Data.OracleClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" 上有相依性,而後者不在目前的目標 Framework ".NETFramework,Version=v4.0,Profile=Client" 中。請移除不在目標 Framework 中的組件參考,或考慮重新設定專案的目標。

解法:
修改專案[屬性][目標 Framework] 從.Net Framework 4 Client profile , 改成.Net Framework

環境:
VS2010 C#.Net
Entlib 5.0, DAAB

參考:
Enterprise Library 5.0, A dependency on System.Data.OracleClient