无法解析符号'EnterpriseLibraryContainer“ [英] Cannot resolve symbol 'EnterpriseLibraryContainer'

查看:494
本文介绍了无法解析符号'EnterpriseLibraryContainer“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始尝试新的MS企业库6.0记录仪块。当我尝试创建一个日志写,我得到的错误:

I just started to try out the new MS Enterprise Library 6.0 Logger block. When I try to create a LogWriter, I get the error:

无法解析符号'EnterpriseLibraryContainer

Cannot resolve symbol 'EnterpriseLibraryContainer'

我所有的引用和usings到位,但不能让过去这个错误。

I have all the references and usings in place, but can't get past this error.

有这个问题的解决方案?

Is there a solution to this issue?

推荐答案

Halleluiah!我刚刚发现一个帖子(即后来消失了一个链接)。这里的故事:

Halleluiah! I just found a post (on a link that has since disappeared). Here's the story:

所有块的引导代码在企业图书馆的6版本已更改。块不再使用统一管理初始化和配置,并且每个块现在包括它自己的引导代码。到EnterpriseLibraryContainer.Current.GetInstance方法从企业库块之一解决任何类型的电话应与地块具体引导代码来代替。例如,要创建一个基于配置在App.config文件中的日志写实例,您现在可以使用下面的代码:

The bootstrapping code for all of the blocks has changed in version 6 of Enterprise Library. The blocks no longer use Unity to manage the initialization and configuration, and each block now includes its own bootstrapping code. Any calls to the EnterpriseLibraryContainer.Current.GetInstance method to resolve a type from one of the Enterprise Library blocks should be replaced with the block specific bootstrap code. For example, to create a LogWriter instance based on configuration in the app.config file, you can now use the following code:

LogWriterFactory logWriterFactory = new LogWriterFactory();
var logWriter = logWriterFactory.Create();



我相信这Blurb的是从微软企业库6和Unity 3迁移指南。

I believe that this blurb is from the "Microsoft Enterprise Library 6 and Unity 3 Migration Guide".

我输入的代码所示,并没有抱怨编译器。现在我可以继续看到日志是如何工作的。

I've entered the code as shown and don't have the compiler complaining. Now I can continue to see how the logging works.

这篇关于无法解析符号'EnterpriseLibraryContainer“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆