Tag: enterprise library

您使用的是Microsoft Enterprise Library吗?

在我的店里,我们目前正在开发我认为的中小型项目。 我们一直在调查企业库以及它如何能够帮助我们开发。 我特别关注Logging块并将其与Log4Net进行比较。 在我看来,企业库块对于简单的应用程序日志记录来说是一个极其过度设计的解决方案。 话虽如此。 您使用的是企业库以及规模较大的项目吗? 您对企业图书馆整体有何看法? 谢谢

哪里有企业库4.1记录器,日志?

我是新手使用记录器。 我已经使用配置向导完成了配置,但我无法理解它在哪里记录消息。 我甚至看到app.config文件但找不到任何日志源。 请指导我在哪里记录日志以及如何查看日志。 这是我的配置文件: 谢谢

访问IsolatedStorageBackingStore时出现HRESULT 0X80131468的原因

我面临的情况是我在W2k3服务器上运行的ASP.NET Web服务(.NET 3.5),该服务器使用CacheManager / IsolatedStorage存储来存储持久化状态变量。 在我们更改物理机器之前,此配置已经运行了很长时间。 现在,当访问该值的代码运行时,它会抛出IsolatedStorageException(在下面发布)。 据我所知,用户/程序集存储是正在访问的内容,执行用户是本地管理员组的成员。 有没有人建议缺少什么特权? 错误 无法创建商店目录。 (HRESULTexception:0x80131468) 堆栈跟踪 键入:Microsoft.Practices.ObjectBuilder2.BuildFailedException。 错误:当前构建操作(构建密钥构建密钥[Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager,缓存管理器])失败:无法创建商店目录。 (来自HRESULT的exception:0x80131468)(策略类型为ConfiguredObjectStrategy,索引2)。 跟踪:位于Microsoft.Practices的Microsoft.Practices.ObjectBuilder2.Builder.BuildUp(IReadWriteLocator定位器,ILifetimeContainer生命周期,IPolicyList策略,IStrategyChain策略,Object buildKey,Object existing)上的Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)。 ObjectBuilder2.Builder.BuildUp [TTypeToBuild](IReadWriteLocator定位器,ILifetimeContainer生命周期,IPolicyList策略,IStrategyChain策略,Object buildKey,Object existing),位于Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp [T](IReadWriteLocator定位器, ILifetimeContainer lifetimeContainer,IConfigurationSource configurationSource)at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.LocatorNameTypeFactoryBase 1.CreateDefault() at Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory.GetCacheManager() at Ept.Commands.SettlementCommand.BeginSettlement() in c:\Projects\EPT\Ept.Framework.Services\Commands\SettlementCommand.cs:line 102 at Ept.Commands.SettlementCommand.ExecuteKernel(SettlementRequest request) in c:\Projects\EPT\Ept.Framework.Services\Commands\SettlementCommand.cs:line 188 at Ept.Command 1.CreateDefault() at Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory.GetCacheManager() at Ept.Commands.SettlementCommand.BeginSettlement() in c:\Projects\EPT\Ept.Framework.Services\Commands\SettlementCommand.cs:line 102 at Ept.Commands.SettlementCommand.ExecuteKernel(SettlementRequest […]

尝试获取ICacheManager类型的实例时出现激活错误,键“Cache Manager”

我似乎在这里遇到了障碍,并希望得到任何能够在这一方面得到帮助的人。 我不确定下面的错误消息是什么意思。 我正在使用企业模式服务的缓存块,但我继续遇到下面的问题。 我下载了最新版本,并尝试逐步解决这个问题,但我似乎无法解决确切的问题,我需要帮助。 提前致谢 Test method WorldBank.Service.Business.UnitTest.TopicsManagerTest.Call_Children_out_of_schoolTest threw exception: Microsoft.Practices.ServiceLocation.ActivationException: Activation error occured while trying to get instance of type ICacheManager, key “Cache Manager” —> Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = “Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager”, name = “Cache Manager”. Exception occurred while: while resolving. Exception is: InvalidOperationException – The current type, Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager, is an interface […]

为什么我得到System.IO.FileLoadException:无法加载文件或程序集,大约每周一次在我的ASP.Net网站上?

我有一个相当简单的内部ASP.Net网站,每周大约加载一次Microsoft.Practices.EnterpriseLibrary.Data dll。 这是Exception消息: System.IO.FileLoadException: Could not load file or assembly ‘Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. Access is denied. File name: ‘Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null’ at foobar.Intranet.Logic.Data.UserDB.SelectByUserName(String userName) at foobar.Intranet.Logic.Info.User.ValidateUser(String userName) in F:\Development\foobar\foobar\foobar.Intranet.Logic\Info\User.cs:line 130 at Login.ValidateUser(String username, String password) in e:\foobar\foobar.Intranet\Login.aspx.cs:line 32 === Pre-bind state information === LOG: User = Unknown LOG: […]

尝试获取LogWriter类型的实例时出现激活错误,键“”?

我有asp.net网站。 我在网站上添加了Microsoft.Practices.EnterpriseLibrary.Logging.dll引用。 在web.cofig文件中,我定义如下。 当我运行代码exception发生在下面的地方。 defaultWriter = EnterpriseLibraryContainer.Current.GetInstance(); //Activation error occured while trying to get instance of type LogWriter, key “” 怎么解决这个?

Unity应用程序块2.0 – 给定的程序集名称或代码库无效

接口(在名为“Interfaces”的程序集中。在项目中: – 接口) namespace Interfaces { public interface IDoSomeWork1 { string DoSomeWork1(); } } namespace Interfaces { public interface IDoSomeWork2 { string DoSomeWork2(); } } 依赖关系(在名为“实体”的程序集中。在项目中: – 实体) namespace Entities { public class ClassB : IDoSomeWork1 { public string DoSomeWork1() { return this.ToString(); } } } namespace Entities { public class ClassC : IDoSomeWork2 { […]

无法加载文件或程序集“Microsoft.Practices.EnterpriseLibrary.Common”或其依赖项之一

我搜索谷歌这个,无法找到问题的解决方案。 我的网站引用了引用企业库数据访问组件的DAL(自定义DLL)。 我从NuGet Package Manager添加了企业库,当我尝试构建网站时,会弹出以下编译错误: 错误44无法加载文件或程序集“Microsoft.Practices.EnterpriseLibrary.Common”或其依赖项之一。 定位的程序集的清单定义与程序集引用不匹配 我尝试在Enterprise Library dlls的DAL中设置Copy Local = True ,并且dll与DAL dll一起传输到网站的Bin目录,但仍会弹出错误。 任何人都可以指导我这….

如何在文件中记录exception?

我希望能够记录每个catch块。 像这样的东西。 catch (Exception exception) { Logger.Write(exception); } 然后配置中的设置将使用客户监听器获取Message和StackTrace属性等。 我想使用Enterprise Library Logging Application Block。 我敢肯定有人必须已经这样做了。

无法安装NuGet包

我正在尝试将Unity包添加到我的解决方案中,但我一直收到列出的消息: 试图解决依赖’Unity(≥3.5.1404.0)’。 ‘Unity’已经为’CommonServiceLocator’定义了依赖关系。 任何想法如何解决这个问题?