【问题标题】:Using Enterprise Library 6.0.x with Visual Studio 2015 without installing .exe file将 Enterprise Library 6.0.x 与 Visual Studio 2015 一起使用,无需安装 .exe 文件
【发布时间】:2017-01-20 11:28:57
【问题描述】:

我需要使用“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

请建议一些解决方案或链接以获得良好的文档,以便在 Visual Studio 2015 中使用 Enterprise Library 6.0.x,而无需安装需要管理员权限的 .exe 文件。

【问题讨论】:

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


    【解决方案1】:

    我已通过以下步骤解决了这个问题:

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

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

    安装后,在 Visual Studio 中打开项目,然后为 Enterprise Library 安装 NuGet 包。然后转到文件 web.config 并右键单击它以编辑 Enterprise library 6.0.x 的服务器配置。如下图所示。

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

    添加后如下图所示。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-19
      • 2015-12-11
      • 1970-01-01
      • 2018-06-08
      • 1970-01-01
      • 1970-01-01
      • 2016-04-25
      • 2015-10-15
      相关资源
      最近更新 更多