使用Enterprise Library 6.0.x和Visual Studio 2015而不安装.exe文件

时间:2017-01-20 11:28:57

标签: logging visual-studio-2015 enterprise-library-6

我需要使用“Enterprise Library 6.0.x”来使用Visual Studio 2015进行日志记录。在此之前我使用过Log4Net,我知道如何使用log4net编写日志文件。但我第一次使用“企业图书馆”。

我为Visual Studio 2015 Enterprise安装了Nuget软件包“EnterpriseLibrary.Logging”版本6.0.1304。现在我正在寻找一个向导工具,我可以在其中配置它以进行日志记录。

我已经浏览了一些博客帖子,他们建议执行一些用“install.ps1”文件编写的powerShell脚本,但是由于管理员权限问题而失败,因为我没有系统管理员权限。

我也访问了以下链接,但没有帮助我:

Enterprise Library 6.0 Configuration Console with Visual Studio 2015 does not contain Autoscaling Settings

Where Enterprise Library Configuration Editor for Visual Studio 2015?

Error writing to file when installing Visual studio 2015 Enterprise

请提供一些解决方案或链接以获取良好的文档,以便在不安装需要管理员权限的.exe文件的情况下将Enterprise Library 6.0.x与Visual Studio 2015一起使用。

1 个答案:

答案 0 :(得分:0)

我已使用以下步骤解决了这个问题:

here下载“Microsoft.Practices.EnterpriseLibrary.ConfigConsole.V6.VS2015.vsix”并安装它。

我不确定此.vsix文件是否可信,但我没有在Microsoft网站上找到它。如果有人拥有来自可靠来源的链接,请提供该链接。

安装后,在visual studio中打开项目,然后安装企业库的NuGet包。然后转到web.config文件并右键单击它以编辑Enterprise Library 6.0.x的服务器配置。如下面的屏幕截图所示。

enter image description here

它将打开一个新窗口进行配置。现在可以为企业库添加任何配置。现在我要添加日志记录设置,如下面的屏幕截图所示。

enter image description here

添加后,它将如下图所示。

enter image description here

可以根据需要进行自定义,保存后会更新配置文件。

相关问题