enterprise-library

generate logs based on date using logging application block for EL 5.0?

拜拜、爱过 提交于 2019-12-24 11:29:23
问题 I am using logging application block for EL 5.0. I defined listener like below. <add name="FlatFile TraceListener" type="Microsoft.Practices.EnterpriseLibrary. Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging" listenerDataType="Microsoft.Practices.EnterpriseLibrary. Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging" fileName="C:\Temp\RssLog.log" header="--------------" footer="----------------------"

performance hit when passing argument of C# type Int64 into T-SQL bigint stored procedure parameter

纵饮孤独 提交于 2019-12-24 09:18:27
问题 I'm noticing serious performance issues with my application when I started using the data type [bigint] for my stored procedure parameters. The parameter data type for the fast code below is [nvarchar](50) . Below is some code that I changed, and this simple call went from < 1 second (fast code) to over 20 seconds (slow code). What could be causing this issue? How can I use [bigint] but maintain performance? I'm using Enterprise Library 5 (Database Application Block) with .NET 4.0. Before

Disable logging on FileConfigurationSourceChanged - LogEnabledFilter

夙愿已清 提交于 2019-12-24 06:43:16
问题 I want Administrators to enable/disable logging at runtime by changing the enabled property of the LogEnabledFilter in the config. There are several threads on SO that explain workarounds, but I want it this way. I tried to change the Logging Enabled Filter like this: private static void FileConfigurationSourceChanged(object sender, ConfigurationSourceChangedEventArgs e) { var fcs = sender as FileConfigurationSource; System.Diagnostics.Debug.WriteLine("-----------

Microsoft Enterprise Library 4.1 Logging Fails on Windows XP SP3

微笑、不失礼 提交于 2019-12-24 05:17:09
问题 I have an application that uses the Ent Lib 4.1 logging application block. This application runs on XP SP2+, Windows Vista, and Windows 7. Most of the time, my logging works fine. (It typically targets the Event Log trace listener.) Sometimes, and I'm not sure what triggers it, a Windows XP machine will simply stop logging. I've tried adding a flat file trace listener to see if the issue was with the Event Log, but the flat file doesn't work either. Rebooting doesn't fix it either. On all of

LINQ support in Enterprise Library Data Access Application Block

孤人 提交于 2019-12-24 03:10:13
问题 Is LINQ support available in the Data Access Application Block. 回答1: I guess the answer is outdated, 5.0 version has support for linq. The following scenarios are supported: Using a DataReader to retrieve multiple rows of data Using a DataSet to retrieve multiple rows of data Executing a command and retrieving the output parameters Executing a command and retrieving a single-value item Performing multiple operations within a transaction Updating a database with data contained in a DataSet

Logging Application Block - Logging the caller

我是研究僧i 提交于 2019-12-23 23:17:54
问题 When logging with Log4Net it's very easy to put class that called the log into the log file. I've found in the past that this makes it very easy to trace through the code and see the flow through the classes. In Log4Net I use the %logger property in the conversion pattern like so: <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" /> And this gives me the output I want: 2008-09-19 15:40:26,906 [3132] ERROR <b>Log4NetTechDemo.Tester</b> [(null)] -

Programmatic configuration of Enterprise Library logging block

浪尽此生 提交于 2019-12-23 19:43:51
问题 I've previously used log4net, but my current employer uses Enterprise Library application blocks. I had previously developed unit tests for my core logging classes as follows and was wondering if someone knew the equivalent for the OneTimeSetup code below for the logging app block (sorry for the long code post): public abstract class DataGathererBase { public readonly log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public void

Cannot resolve type runtime error after registering the Enterprise Library into the GAC

醉酒当歌 提交于 2019-12-23 13:13:12
问题 I worked on registering the Enterprise Library assemblies into the Global Assembly Cache (GAC). I am using version 5.0 of the Enterprise Library that I signed with my own key, and I am using the assemblies in a number of .NET 4.0 applications. After successfully registering the Enterprise Library assemblies into the GAC, the application started with this message: The type 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary

EnterpriseLibrary Error

谁都会走 提交于 2019-12-23 09:03:41
问题 I'm receiving reports of a rare and intermittent error in our live environment. I have been unsuccessful in my attempts to reproduce it, and the error itself is a slight mystery. Add to that, it seems to be something involving Enterprise Library tracing (we're using version 5.0) - all in all, a bit of a pain. This is happening on Windows Sever 2008, application is on .Net Framework 4.0 (WPF). The error message and the stack trace follow: ArgumentNullException: Value cannot be null. Parameter

How do you refill a byte array using SqlDataReader?

瘦欲@ 提交于 2019-12-23 06:24:14
问题 This is in reference to: byte[] and efficiently passing by reference And the SqlDataReader found in this post: Getting binary data using SqlDataReader Inside a loop, I'm calling a database and returning a large object ( varbinary[max] ). Currently, I'm running into OutOfMemory exceptions, so I'm trying to reduce the footprint in the Large Object Heap (LOH). So, I'm creating a byte array for the largest file that I'd download and adding some padding just in case. For instance: byte[]