使用Enterprise Library 6应用程序块

3

最新的企业库6已经发布,可以在这里下载。我已经将EnterpriseLibrary6-binaries.exe下载并提取到了C盘上一个文件夹中。阅读自述文件得知:

MICROSOFT ENTERPRISE LIBRARY 6

Summary: This package contains Enterprise Library configuration console, MSMQ distributor service, merge configuration tool and a script to download binaries for all application blocks from NuGet.

In order to get all the binaries, run the install-packages.ps1 script.

Note: For the Semantic Logging Application Block Out-of-Process service, a separate package is available for download.

我接着运行Powershell并运行脚本。现在,我查看了我提取.exe文件的文件夹,所有二进制文件都在那里。现在,这里是来自Enterprise Library 6 .chm的说明。

To install the integrated Visual Studio configuration editor 

1. On the Visual Studio Tools menu, choose Extensions and Updates. 
2. In the Extensions and Updates dialog, search online for EnterpriseLibrary.config. 
3. Click the Download button to download and install the Enterprise Library configuration editor. 
4. Restart Visual Studio to complete the installation. 


To launch and use the configuration editor from Visual Studio 

1. Open a solution in Visual Studio. 
2. If the solution does not contain a configuration file, add one using the Visual Studio Add menu. 
3. In Solution Explorer, right-click the configuration file and then click Edit Enterprise Library V6 Configuration. This launches the integrated configuration editor or the appropriate standalone version of the configuration tool. 

我卡在第三步了。我有一个包含web.config的WCF服务项目。我右键单击web.config,但是没有看到“Edit Enterprise Library V6 Configuration”上下文菜单选项。

我看到了一个“Edit Server Configuration File v6”。然而,当我点击它时,会出现以下错误:

enter image description here

我只是想在我的WCF服务项目中使用异常处理应用程序块。我已经在网上找了很久,但是找不到任何简单的逐步教程来指导我。非常感谢您的帮助。

4个回答

4

您需要将“Enterprise Library v6二进制文件路径”的解决方案属性设置为提取“EnterpriseLibrary6-binaries.exe”文件夹的路径。

您可以通过单击解决方案,然后按F4键查看属性窗口来完成此操作,但您需要确保您的“Enterprise Library Config工具”是v6版本。 http://www.microsoft.com/en-us/download/details.aspx?id=38789

Visual Studio Gallery提供的Enterprise Library 5 Config工具显然是错误的版本。


3

我需要使用NuGet来安装我想在项目中使用的应用程序块。对于我来说,是通过Tools >> Library Package Manager >> Manage NuGet Packages for solution来添加适当的EntLib 6 Exception Handling Application Block WCF Provider。


0

只需从以下链接下载Microsoft.Practices.EnterpriseLibrary.ConfigConsoleV6.vsix,并在安装时提供VS2012或Vs2013。
http://www.microsoft.com/en-us/download/details.aspx?id=38789

安装后重新启动Visual Studio。 您将获得Enterprise Library 6.0配置。 默认情况下,VS中的“扩展和更新”提供5.0配置,我们需要6.0才能工作。


0
这是对我有效的方法:
这里下载Microsoft.Practices.EnterpriseLibrary.ConfigConsoleV6.vsix,在安装过程中提供VS2012或VS2013。
然后重新启动您的VS2012/2013,您就可以开始使用了!

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接