2016-02-11 28 views
1

我正在使用Visual Studio應用程序,我想使用數據訪問應用程序塊,它是Microsoft Enterprise庫5.0的一部分。我一直在按照this guide中的步驟安裝數據訪問應用程序塊。還有就是問我引用下面的組件上this page一步:爲什麼我找不到需要引用的企業程序集?

Microsoft.Practices.EnterpriseLibrary.Data.dll

Microsoft.Practices.EnterpriseLibrary.Common.dll

Microsoft.Practices.Unity .DLL

Microsoft.Practices.ServiceLocation.dll

Microsoft.Practices.Unity.Interception.dll

問題是,當我嘗試添加它們時,我看不到它們在參考管理器中的任何位置列出。

有人可以向我解釋爲什麼我沒有看到他們/我怎麼能找到他們?

感謝

+0

必須從CodePlex項目網站下載EntLib,然後才能瞭解如何安裝程序集。他們不附帶Visual Studio。 –

回答

1

下載你需要的組件,最簡單的方法是使用NuGet安裝Data Access Application Block

在Visual Studio中(不知道您使用的是哪個版本 - 這是針對Visual Studio 2013的)轉到菜單並選擇工具 - > NuGet程序包管理器 - >程序包管理器控制檯。應該出現控制檯。如果沒有,則選擇View-> Other Windows-> Package Manager Console。

接下來的軟件包管理器控制檯類型:

PM>安裝,包裝EnterpriseLibrary.Data -Version 5.0.505

這將安裝以前(第5版)數據訪問應用程序塊和所有的依賴關係。您應該看到在Package Manager控制檯

Attempting to resolve dependency 'EnterpriseLibrary.Common (≥ 5.0)'. 
Attempting to resolve dependency 'Unity.Interception (≥ 2.1)'. 
Attempting to resolve dependency 'Unity (≥ 2.1)'. 
Attempting to resolve dependency 'CommonServiceLocator (≥ 1.0)'. 
Installing 'CommonServiceLocator 1.0'. 
Successfully installed 'CommonServiceLocator 1.0'. 
Installing 'Unity 2.1.505.0'. 
You are downloading Unity from Microsoft patterns & practices, the license agreement to which is available at http://www.opensource.org/licenses/ms-pl. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device. 
Successfully installed 'Unity 2.1.505.0'. 
Installing 'Unity.Interception 2.1.505.0'. 
You are downloading Unity.Interception from Microsoft patterns & practices, the license agreement to which is available at http://www.opensource.org/licenses/ms-pl. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device. 
Successfully installed 'Unity.Interception 2.1.505.0'. 
Installing 'EnterpriseLibrary.Common 5.0.505.0'. 
You are downloading EnterpriseLibrary.Common from Microsoft, the license agreement to which is available at http://www.opensource.org/licenses/ms-pl. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device. 
Successfully installed 'EnterpriseLibrary.Common 5.0.505.0'. 
Installing 'EnterpriseLibrary.Data 5.0.505.0'. 
You are downloading EnterpriseLibrary.Data from Microsoft, the license agreement to which is available at http://www.opensource.org/licenses/ms-pl. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device. 
Successfully installed 'EnterpriseLibrary.Data 5.0.505.0'. 
Adding 'CommonServiceLocator 1.0' to ConsoleApplication1. 
Successfully added 'CommonServiceLocator 1.0' to ConsoleApplication1. 
Adding 'Unity 2.1.505.0' to ConsoleApplication1. 
Successfully added 'Unity 2.1.505.0' to ConsoleApplication1. 
Adding 'Unity.Interception 2.1.505.0' to ConsoleApplication1. 
Successfully added 'Unity.Interception 2.1.505.0' to ConsoleApplication1. 
Adding 'EnterpriseLibrary.Common 5.0.505.0' to ConsoleApplication1. 
Successfully added 'EnterpriseLibrary.Common 5.0.505.0' to ConsoleApplication1. 
Adding 'EnterpriseLibrary.Data 5.0.505.0' to ConsoleApplication1. 
Successfully added 'EnterpriseLibrary.Data 5.0.505.0' to ConsoleApplication1. 

其他方式下面將download Enterprise Library,然後從安裝位置參考的各個組件。

相關問題