enterprise-library

What do you do if your error logging fails, and how do you test that its working in production?

What do you do if you're error logging code fails? How do you make sure that its currently working? How do you know if its not working? How do you test that its working in a production environment? Should I throw an exception if all else fails? The code below uses Microsoft's Enterprise Library Logging Application Block. How do you m...

How-to Prevent Dirty Records to be updated

Assuming a Product class public class Product { public String Name {get;set;} public Decimal Price {get;set;} public Int32 QuantityStock {get;set;} } Now assuming Two Clients who "Request" the same Product at the same time named "Product 1" with the following values Name = "Product 1" Price = 10 QuantityStock = 100 The...

Upgrading Enterprise Library (1.0) to LINQ or Entity framework

We are working on a C# windows project with enterprise library 1.0 that needs to be updated to either LINQ or Entity framework. (.NET 3.5) The application uses mainly SQL connections as stored procedures and XML files to store settings. What is the pros and cons with LINQ and Entity framework in this case? Are the rumors true that LI...

Migrating from NUnit to Team System error in Enterprise library configuration

I get this error from my migration of NUnit to Team System when running some of the tests in Visual Studio: Test method XXX.XXX.Data.Tests.Path.Method> threw exception:  System.Configuration.ConfigurationException: Invalid section name. The section 'dataConfiguration' does not exist in the requested configuration file 'C:...

Using RangeValidator with byte

This is the property declaration in question: [RangeValidator(1,RangeBoundaryType.Inclusive,255,RangeBoundaryType.Inclusive,MessageTemplate = "StartFlexibility is out of range")] public byte StartFlexibility { get; set; } When the validate method is called, a FormatException is thrown telling me that the value type needs to be In...

Subsonic 2.2 and EnterpriseLibrary 4.1 in Framework 2.0

Hi i use subsonic version 2.2 in my project and this version of subsonic use EnterpriseLibrary 4.1 but i use EnterpriseLibrary 3.1 because i use framework 2.0, the version 4.1 need framework 3.5 or later, the problem is when i use subsonic in the web config i have this and when is load fail, and showme this Could not load file or as...

Firing an email when any error is logged via Enterprise Library

Hi everyone. I've got a ASP.NET website that is utilizing many aspects of the Enterprise Library (3.1), including the Logging Application Block. I'm using a custom TraceListener to handle all of the logging requests. I want to add an email listener that will fire an email whenever an error occurs in the website. To be clear (and beca...

Enterprise Library 4.1 Exception policy

Hello, I am using Enterprise Library 4.1 and want to implement Exception handling and logging. I am able to setup one policy that handles general Exceptions of the System.Exception type. I call this policy 'Data Access Policy'. In a general application development rule, how many policies should I create? What are the best practices for...

Need to use Prepare() in Enterprise Library functions?

Hi, I am using Enterprise Library 4.0 for my application, I need to know whether we need to handle Prepare() method explicitly. Or does it implemented internally to the library. I am only dealing with SQL statements, not Stored Procedures. I am always using "db.ExecuteDataSet(CommandType.Text, sql)" Note: As per my knowledge, Prepare...

Why does Sql Server connection TimesOut

Hi I am using Enterprise Library Data for my Sql database. I am using version 3.1. I am using this code to execute a long running sp (about 1 min). Dim db As SqlDatabase = New SqlDatabase(System.Web.Configuration.WebConfigurationManager.ConnectionStrings("portalConnection").ConnectionString) db.ExecuteNonQuery("spna...

Bundle enterprise library instead of installing

Hi folks, does anybody know if it's possible (or have experience doing so) to simply bundle the microsoft enterprise library components in a .net solution instead of performing the installation? I'm trying to avoid putting a customer through the installation step. Thanks for your response!! :-) ...

System.ServiceModel.Security.MessageSecurityException occuring under ExceptionShielding

We are using the Enterprise Library 4.1 Exception Handling Application Block's ExceptionShielding feature in combination with a custom RoleProvider with our WCF services. When the RoleProvider determines an user is not in a role and returns false from the IsInRole method, the following exception is occurring: System.ServiceModel.Securi...

Enterprise Library How to Implement a IExceptionHandler?

I have to implement a IExceptionHandler for the Enteprise Library 4.1. In my particular case I want to use it to log the exception to Fogbugz but the inner details is not what I am asking about. What I need is how to - best practicies - implement it, How to get the config for a app.config or web.config. etc. I have code This so far: ...

Enterprise Security Application Block in Conjunction With MembershipProvider in ASP.NET

Looking to implement authentication/authorisation for ASP.NET app Was looking into using Provider model MembershipProvider SQLServerMembershipProvider etc as makes good sense to me. However I'm looking into the Enterprise Security Application block as well. My question is can/should the two be used in tandem? ...

What is the Microsoft Enterprise Application Blocks relationship to the ASP.NET provider model?

What is the Microsoft Enterprise Application Blocks relationship to the ASP.NET provider model? (if any) ...

Handling a dynamic Connection String with DAAB

I'm in the process of adding a Data Access Layer for our ASP.Net 2.0 web application that was written almost exclusively using in-line SQL calls and copious use of copy/paste. Due to business concerns I am only able to re-factor small portions of the application at a time (can't settle in and do a huge re-design), so I have to live with ...

Upgrading Enterprise library - v1.0 to v4.1

I have an application currently using the 1.0 version of ent-lib, which I am trying to use with ent-lib 4.1. It is currently using these blocks: Common, Data, Logging, Security.Cryptography, Security and Configuration. I have so far been sitting with the source of both ent-lib 1.0 and 4.1 trying to find out which classes correspond to wh...

Policy Injection Application Block in real world apps?

The PIAB of the Microsoft Enterprise Library looks like it could be used for some pretty cool things. Many people were questioning how it would perform in real world applications, due to its use of remoting-based interception techniques. I haven't heard much about it recently and am wondering if anyone has had good or bad experiences f...

ASP.3.5 Error while using Enterprise Library

I have a VisualStudio solution created in Vs2005 which is making use of Microsoft Enterprise Data Library.Now I converted this to Visual studio 2008 .Now when i buid the project ,i am getting an error like the below An error occurred creating the configuration section handler for dataConfiguration: Could not load file or assembly 'Mi...

ExceptionHandling error on dev website only when VPNing into my office network

I'm using the Enterprise Library Exception handling block in an ASP.NET web application. I was just using this app yesterday at work (non-VPN) and everything worked fine. I'm working at home today and as soon as I have forms auth'd into the app, I get this error: An error occurred creating the configuration section handler for exception...