2016-02-11 2 views
1

Я работаю над приложением Visual Studio, и я хочу использовать блок приложений доступа к данным, который входит в состав Microsoft Enterprise library 5.0. Я выполнил следующие шаги в this guide, чтобы установить блок приложения доступа к данным. Существует шаг на this page, который просит меня ссылаться на следующие узлы:Почему я не могу найти сборки Enterprise, которые мне нужны для ссылки?

Microsoft.Practices.EnterpriseLibrary.Data.dll

Microsoft.Practices.EnterpriseLibrary.Common.dll

Microsoft.Practices.Unity .dll

Microsoft.Practices.ServiceLocation.dll

Microsoft.Practices.Unity.Interception.dll

Проблема в том, что когда я пытаюсь их добавить, я не вижу их в списке в диспетчере ссылок.

Может кто-нибудь объяснить мне, почему я их не вижу/как я могу их найти?

Благодаря

+0

EntLib должен быть загружен с сайта проекта CodePlex, а затем вы можете узнать, как установить сборки. Они не поставляются с Visual Studio. –

ответ

1

Самый простой способ загрузки сборок, нужно это использовать NuGet установить Data Access Application Block.

В Visual Studio (не уверен, какая версия вы используете - это для Visual Studio 2013) перейдите в меню и выберите «Инструменты»> «Диспетчер пакетов NuGet» -> «Менеджер пакетов». Появится консоль. Если это не так, выберите View-> Other Windows-> Package Manager Console.

Далее в типе Package Manager Console:

PM> Install-Package EnterpriseLibrary.Data -Version 5.0.505

Это устанавливает предыдущий (версия 5) Доступ к данным Блок приложений и все его зависимости. Вы должны увидеть следующее в Package Manager Console

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, а затем ссылаться на отдельные узлы из местоположения установки.