enterprise-library

Problem in reading connection string from App.Config when using NUnit 2.5.2

萝らか妹 提交于 2019-11-27 15:18:45
I'm using Microsoft Visual Studio 2005 with Enterprise Library 3.1. I have a data access layer which is a separate visual studio class library project. I wrote unit tests in a another class library and trying to call the data access method, but I keep getting PSMCP.Dal.Tests.DataManagerTests.GetAAAReturnsDataReader: System.NullReferenceException : Object reference not set to an instance of an object. at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseMapper.MapName(String name, IConfigurationSource configSource) at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder

Can not install NuGet package

淺唱寂寞╮ 提交于 2019-11-27 14:36:29
I am trying to add the Unity package to my solution, but I keep receiving the listed message: Attempting to resolve dependency 'Unity (≥ 3.5.1404.0)'. 'Unity' already has a dependency defined for 'CommonServiceLocator'. Any Idea how to fix this? This problem arises with older version of nuget. Update nuget PM, 2.8.50313.46 is current version, Look for the latest for VS 2012 You are using Higher version .Net framework. And you are adding Lower version of Unity in to it. your Application Framework will be above 4.0 or 4.0 and you are adding Unity frame work which is of .net frame 3.5. 来源: https:

System.Web.Caching vs. Enterprise Library Caching Block

﹥>﹥吖頭↗ 提交于 2019-11-27 06:14:30
For a .NET component that will be used in both web applications and rich client applications, there seem to be two obvious options for caching: System.Web.Caching or the Ent. Lib. Caching Block. What do you use? Why? System.Web.Caching Is this safe to use outside of web apps? I've seen mixed information, but I think the answer is maybe-kind-of-not-really. a KB article warning against 1.0 and 1.1 non web app use The 2.0 page has a comment that indicates it's OK: http://msdn.microsoft.com/en-us/library/system.web.caching.cache(VS.80).aspx Scott Hanselman is creeped out by the notion The 3.5 page

Performance of system.runtime.caching

家住魔仙堡 提交于 2019-11-27 05:28:54
问题 I have compared the performance of system.runtime.caching in .NET 4.0 and the Enterprise Library Caching Block and to my surprise it performs terribly in comparison when fetching large data collections from cache items. Enterprise Library fetches 100 objects in about 0,15ms, 10000 objects in about 0,25ms. This is fast, and natural for an in-process cache because no data actually needs to be copied (only references). The .NET 4.0 caching fetches 100 objects in about 25ms, 10000 objects in

How to effectively log asynchronously?

筅森魡賤 提交于 2019-11-27 04:57:19
问题 I am using Enterprise Library 4 on one of my projects for logging (and other purposes). I've noticed that there is some cost to the logging that I am doing that I can mitigate by doing the logging on a separate thread. The way I am doing this now is that I create a LogEntry object and then I call BeginInvoke on a delegate that calls Logger.Write. new Action<LogEntry>(Logger.Write).BeginInvoke(le, null, null); What I'd really like to do is add the log message to a queue and then have a single

How to Log Exception in a file?

独自空忆成欢 提交于 2019-11-27 03:16:46
问题 I want to be able to do logging in every catch block. Something like this. catch (Exception exception) { Logger.Write(exception); } and then the settings in the configuration will pick up the Message and StackTrace property etc using customer listener. I would like to use Enterprise Library Logging Application Block. I'm sure someone must have done this already. 回答1: Others have posted some good links on getting the Logging Application Block (LAB) working so I won't duplicate that here. In

Can Unity be made to not throw SynchronizationLockException all the time?

一个人想着一个人 提交于 2019-11-27 02:56:01
The Unity dependency injection container has what seems to be a widely known issue where the SynchronizedLifetimeManager will often cause the Monitor.Exit method to throw a SynchronizationLockException which is then caught and ignored. This is a problem for me because I like to debug with Visual Studio set to break on any thrown exception, so every time my application starts up I'm breaking on this exception multiple times for no reason. How can I prevent this exception from being thrown? Wherever this issues is mentioned elsewhere on the web, the advice usually involves changing the debugger

How do I create a hierarchy of lognames in the Windows event system?

流过昼夜 提交于 2019-11-27 00:46:06
问题 I am logging messages using Enterprise Library. I want some of these (typically errors and warnings) to be passed to the Windows event-system). I today route these via entlib.config. This solution works and so far, so good. But, I have more needs than what this solution provides me. I have multiple installations that should log to different logs, but I want their names to be logical and intuitive in the event-viewer. But, the Windows event-system cannot have two categories where the first 8

How to resolve “Could not find schema information for the element/attribute <xxx>”?

牧云@^-^@ 提交于 2019-11-27 00:16:50
问题 In visual studio, I have an asp.net 3.5 project that is using MS Enterprise Library 4.0 application blocks. When I have my web config file open, my Error list fills up with 99 messages with things like Could not find schema information for the element 'dataConfiguration'. Could not find schema information for the attribute 'defaultDatabase'. Could not find schema information for the element 'loggingConfiguration'. Could not find schema information for the attribute 'tracingEnabled'. Could not

Does Enterprise Library 6 work with Visual Studio 2013 and/or 2015?

柔情痞子 提交于 2019-11-26 22:55:25
问题 It seems it does not and we are planning to use it (Logging, Exception, etc..) for future projects. Is it still supported? I do not see a lot of activity around this tool as there used to be. We already have NewRelic so also be helpful to know if NewRelic can do logging/Exception handling already. For example, can I create custom logs or exceptions and see them in the new relic dashboard? 回答1: It does. You may add Enterprise Library 6 into your project via Nuget Here is the sample application