enterprise-library

.Net Object validation

Can I use Validation Application Block, for a high performance program? I mean when I'm getting objects from a stream and I need to validate their values as I parse data coming. As I understand reflection is involved... Is there any alternative tools that i can use for object validation? ...

Enterprise library validation application block with inheritance

I'm using Enterprise library Validation application block. abstract Class A { public int fieldA; } class B:A { } I add validators to type B. I'm not able to find the field fieldA and also even if I enter it in configuration, the validation does not succeed. Does VAB not take the abstract class and inherited properties or fields into...

How to Register and resolve objects using rules in Microsoft Unity

Hi, I have a scenario where I have multiple classes implementing one interface. When at runtime the resolution is done I want some rules to execute to give me back the required instance. I am thinking of writing some extension for Unity which can accept the configurations like this: <unity xmlns="http://schemas.microsoft.com/practices/...

how to determine which version of enterprise library a dll came from?

I have an application using a dll from the 'Microsoft Enterprise Library'. How do I find out which version of the 'Enterprise library' the dll came from? The dll is 'Microsoft.ApplicationBlocks.ExceptionManagement.dll' and it's 'Product' and 'File' version is 1.0.3055.29252. ...

Enterprise Library Validation Block: Validating a nullable datetime

Hi, I'm trying to validate a nullable datetime using the Enterprise Library Validation Block without success. I've got a WinForm with a DateTimePicker with a visible checkbox. The DateTimePicker is bound to a nullable DateTime prooperty using a custom databinding where the parsing is done like this (if the DateTimePicker is not checked...

Why do I get System.IO.FileLoadException: Could not load file or assembly, about once a week on my ASP.Net Website?

I have a rather simple internal ASP.Net Website that has issues loading the Microsoft.Practices.EnterpriseLibrary.Data dll about once a week. Here is the Exception message: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or ...

Enterprise Library 5: How to configure FileConfigurationSource relative to asp.net web application folder?

I have my validation configuration stored in validation.config in my Business Object project. The config file is set to copy if newer The business object project is referenced by my web project, therefore, the validation.config copies to the bin folder of my web application. In my web.config I have the validation configuration redirec...

Performance of system.runtime.caching

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 a...

How to use PropertyProxyValidator with ServerSideValidationExtender at runtime

I have added a StringLenthValidator attribute to the name field of my CSLA business object, with that I am trying to use the AJAX PropertyProxyValidator to server-validate the string inputs for that name field. I was able to create the control at run-time and it worked fine, but it's not using the PropertyProxyValidator to report the Er...

Is the MS DAAB 4.1 Database object threadsafe?

I've come across some code that has a singleton which creates / reuses a static instance of the MSDAAB Database object. Is the Database object threadsafe after creation? I couldn't find anything one way or the other in the MSDAAB docs. ...

Microsoft Application block DLL V2 and V4.1 references

My application is referencing Microsoft Enterprise library V4.1 while one of the older DLL (external application) requires a reference to Microsoft Enterprise library V2.0. I know for sure that i can register both of these assemblies in the GAC and the application will start reading relevant DLL as required but that is not a solution for...

Fluent configuration problem

I'm trying to get fluent configuration working without success. I get the following error: Activation error occured while trying to get instance of type LogWriter, key "" when I try to access the logwriter: Dim logwriter As LogWriter = EnterpriseLibraryContainer.Current.GetInstance(Of LogWriter)() Configuration: Dim formatBuild...

Enterprise Library Logging 4.1 does not write to errors listener when file is inaccessible

We have Enterprise Library 4.1 logging set up to write to the Event Log when regular logging fails. This works fine when logging is configured incorrectly (e.g. an invalid character in the listener fileName attribute), but nothing is written to the event log when the configured file cannot be written to due to invalid permissions. FWIW...

Enterprise Library 5.0: Bug in exception logging to rolling log file?

So, what I'm trying to accomplish is that my exceptions get logged into the rolling log file (which I use for other things, especially tracing - which is VERY important in the environment I'm working in - too). Problem is that I get all traces into rolling.log, but the exceptions get logged into files with the following name scheme: {g...

How do I get the EntLib database settings to stay deleted?

I'm using EntLib 5.0 for logging and exception handling, but not for data access. Everytime I delete the 'database settings' app block using the entlib designer, it re-adds itself after I rebuild the application. It wouldn't be a problem and I'd just leave it except that it creates LocalSqlServer and LocalMySqlServer instances automatic...

How can I get my logger to overwrite old log file in C# using Enterprise Library?

Using Enterprise Library 3.1, I have a logger that, once it reaches its "rollSizeKB" refuses to overwrite the log file. What am I missing? <listeners> <add formatter="Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLib...

System.Diagnostics.Debug namespace vs Other logging solutions (log4net, MS Enterprise Library, etc.)

Hi everyone! I'm currently investigating various logging possibilities for .net projects and I can't decide between System.Diagnostics.Debug/Trace features and third party libraries like log4net, MS Enterprise Library, NLog, etc. At the moment I have found out this: System.Diagnostics is rather difficult to configure and to use since y...

DAL + BLL + LINQ + Enterprise Library 5 + .net 3.5

What are the Best practices for coding Data Access Layer and Business Logic Layer with combination of LINQ and Enterprise Library 5.0 in .net 3.5? ...

log4Net, MVC, and dependency injection

I have an application with a few classic layers DAL, BLL, PL, and Unit Of Work. The goal is to log BL layer with MVC User info. In MVC presenter layer I made my own realization of DefaultControllerFactory for creating Service Locator. Here I register IBusinessLayer on BusinessLayerConcrete, and Controllers on themselves for their next...

Is there a way to change the text formatter at runtime using the entlib logging application block?

I have an application that logs to a rolling text file using the MS enterprise library 4.1 logging application block. Is it possible to have multiple text formatters and switch between them during runtime? ...