enterprise-library

When should I use Tracing vs Logger.NET, Enterprise Library, log4net or Ukadc.Diagnostics?

只谈情不闲聊 提交于 2019-12-17 17:21:19
问题 How do I choose between standard tracing, Logger.NET, Enterprise Library, log4net or Ukadc.Diagnostics? Is there a situation where one is more appropriate than the other? ... what would that be? (ASP.NET, console app, Azure Cloud, SOHO, Enterprise...) What are the benefits or drawbacks? Did I miss any other major logging frameworks? 回答1: There are many similar questions here on SO: Logging best practices log4net versus TraceSource Silverlight Logging framework and/or best practices log4net vs

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

时光怂恿深爱的人放手 提交于 2019-12-17 13:09:04
问题 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,

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

醉酒当歌 提交于 2019-12-17 13:06:33
问题 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,

System.Web.Caching vs. Enterprise Library Caching Block

帅比萌擦擦* 提交于 2019-12-17 08:09:24
问题 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

Pitfalls for converting a .net 2.0 solution to .net 3.5

只愿长相守 提交于 2019-12-14 03:45:41
问题 We're moving a solution with 20+ projects from .net 2.0 to 3.5 and at the same time moving from Visual Studio 2005 to 2008. We're also at the same time switching from MS Entlib 2.0 to 4.0. Is there any reasons not to let the Visual Studio wizard convert the solution for us? Is 3.5 fully backwards compatible with 2.0? Is Entlib 4.0 fully backwards compatible with 2.0? Edit: I might been a bit confused when I wrote this, the backwards compatability is supposed to mean; is there anything that

Enterprise Library Class Library App.Config

拈花ヽ惹草 提交于 2019-12-13 18:40:57
问题 I have a class library whcih is a Wrapper class for Enterprise Library Logging Application Block. There I kept an App.Config configuration file. Where all the Enterprise Library related configurations are present. Now I refered this Class Library in a ASP.NET Web Application. Problem I am getting is: The ASP.NET Web Application is unable to read the App.Config file to fetch Configuration Information. And I am getting below Exception: 回答1: Config files are per appdomain, not per binary. If you

Is the Microsoft Enterprise Library Data Access Application Block thread safe?

匆匆过客 提交于 2019-12-13 18:33:07
问题 I can't seem to find any documentation regarding thread safety... In particular - is the Database class (and subclasses) thread safe How would I find this out for myself? Are there references to thread safety for classes on the MSDN site? 回答1: Yes, instances of the Database class are thread-safe. However, objects created by it (such as SqlDataReader ) are not. 来源: https://stackoverflow.com/questions/2872023/is-the-microsoft-enterprise-library-data-access-application-block-thread-safe

Unity to Resolve By Name

老子叫甜甜 提交于 2019-12-13 18:25:58
问题 I'm trying to get Unity to be my factory in a factory pattern, hence return different implementations of an Interface depending upon the named instance. I have the following code public static class Factory { private static readonly IUnityContainer container; static Factory() { container = new UnityContainer(); container .AddNewExtension<EnterpriseLibraryCoreExtension>() .AddNewExtension<Interception>() .RegisterType<IInterceptionBehavior, LoggingBehaviour>() //register the implemantation1

EntLib Way to Bind “Null” Value to Parameter

▼魔方 西西 提交于 2019-12-13 16:22:38
问题 I wish to pass Null Value to the parameter as follow: _db.AddInParameter(dbCommand, "Id", DBNull.Value , myContactPerson.Id); I am receiving the following error : " can not convert "System.DBNull to System.Data.DbType" . I know the meaning of this error. But i need to supply null value to myContactPerson.Id How can i achieve this ? 回答1: If myContactPerson.Id isn't an auto-number, then why not just pass 0. 回答2: DBType should be passed in that parameter and should match your the dbtype (string,

Throwing FaultException using Custom Exception Handler EL WCF

做~自己de王妃 提交于 2019-12-13 13:25:13
问题 So I'm trying to use Enterprise Library in my WCF service to do some of the exception-related work for me. My idea is to set up a " Custom Exception Handler " for say "NullReferenceException" and in the "Custom Exception Handler" create FaultException exception. My understanding is that this "new" exception will then make it across the wire and I will catch it at the client. Some code for better understanding: WCF service: [ServiceContract(Name="MyService", ConfigurationName="MyNamespace