enterprise-library

enterprise library dbcommand AddInParameter method

北战南征 提交于 2019-12-11 07:46:46
问题 I have been using enterprise library since long time. We are changing column type varchar to nvarchar in database to support different language. We do have some legacy code that is using traditional way to connect to database like using command object. In that code, when creating sqlparameters, parameter's datatype is specified whether it is int or varchar. It's easy to change from varchar to nvarchar there. But I am wondering about while using enterprise library where we specify .net

How to release Logger file handler when using with Enterprise Library?

无人久伴 提交于 2019-12-11 06:59:15
问题 First, I followed the instructions as stated here Everything works well. Except one thing when i deployed to Azure. When there is logging taking place, the file created seems to be 'locked' by the process, such that I am unable to 'transfer the file' over to my local. When this happens, the failure takes place forever, until i manually stop my api process, then only i am able to transfer the file. Question: How to properly write the code to 'release the file lock'? Below shows my code snippet

Entlib and interop: does it work, and where does the config file go?

↘锁芯ラ 提交于 2019-12-11 06:53:46
问题 I'm trying to use the EntLib 3.1 within .net code for a dll which is registered for COM interop. Where do I put the config file? Alternatively, is there a way to specify within the dll code where it should get the entlib config from? Since my dll will be called from COM I don't always know what exe will be calling it. I created a simple app which uses entlib Logging, with two classes: 'CallingApp' and 'MyComThing'. When I call a method of MyComThing from CallingApp it logs using the

Write to multiple files Enterprise Library Logger

心已入冬 提交于 2019-12-11 05:49:16
问题 Is it possible using Enterprise Library Logger to log to multiple files grouped by date ? For example Trace-08-22-2011.log, Trace-08-23-2011.log. 回答1: Yes, but not with the TraceListeners that ship with Enterprise-Library. What you need is a custom TraceListener or at least TraceListenerData which is used indirectly as a trace listener factory (GetCreationExpression). The easiers way to do what you've described is to inherit from RollingFlatFileTraceListenerData and overrice

entlib CustomTraceListener unresolved

若如初见. 提交于 2019-12-11 04:57:44
问题 im new to Enterprise Library (5, with the optional update), and am trying to use my own CustomTraceListener with the Logging Block. Logging works with a supplied flat file listener, but i dont seem to be able to extend that to my custom class. Logs to FlatFileListener, but Not to my CustomListener: static UnityContainer _container; static LogWriter _writer; internal static void Inf(this string message) { if (_container == null) { _container = new UnityContainer(); _container.AddNewExtension

spring Net vs enterprise library

[亡魂溺海] 提交于 2019-12-11 03:14:29
问题 I've been searching the web for information about a Net Framework I can use to "take it and keep it" from now on in my projects, and I've almost made a decision, but I would like some reference about what direction the market is moving on. I can't find anything in google about which is the most used, which one have the most future, etc. I've been reading about other Frameworks too (Castle, Nhibernate, CSLA), but these 2 (Spring Net & EntLib) seem to be the more robust to me. Do you have

Enterprise Logging not translating environment variables in XML Trace Listener fileName specification

狂风中的少年 提交于 2019-12-11 02:44:24
问题 I am using Microsoft Enterprise Library 5.0 Optional Update 1 for logging. I've got a declared section in my app.config file as follows: <loggingConfiguration name="LLamasoftLoggingConfiguration" tracingEnabled="true" defaultCategory="General"> <listeners> <add name="XML Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.XmlTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

MSTest with Moq - DAL setup

感情迁移 提交于 2019-12-10 23:46:04
问题 I'm new to Moq, and just started on a project that's already in development. I'm responsible for setting up unit testing. There's a custom class for the DatabaseFactory that uses EnterpriseLibrary and looks like this: public Database CreateCommonDatabase() { return CreateDatabaseInstance(string.Empty); } private static Database CreateDatabaseInstance(string foo) { var database = clientCode == string.Empty ? DatabaseFactory.CreateDatabase("COMMON") : new OracleDatabase(new ClientConnections()

Entlib5 Validation [IgnoreNull] throws exception while adding objects to list

旧街凉风 提交于 2019-12-10 22:43:32
问题 I have a class Partner and I use entlib5 validation block to validate class's fields (using data anottations). In one of method I read db table and create binding list of Partner's objects, but if there is an [IgnoreNull] annotation or [ValidationComposition]+[NotNullValidator] i get an System.NotSupportedException (for example: A validation attribute of type ValidatorCompositionAttribute cannot be used to validate values.) If I use only [StringLengthValidator] there isn't any exception (but

Enable/Disable Enterprise Library logging on production

别说谁变了你拦得住时间么 提交于 2019-12-10 16:47:38
问题 On my production, I don't want to have log entry with severity Verbose (or Debug). I need only the info, error etc. What is the right method to enable and disable logging (the debug entries)? I did some research and one possibility is to use Custom Filter class to enable and disable all logs with severity "verbose". But When deploying application on production, what is the right way to enable and disable? 回答1: You can set your logging level in your config file, that way, should you need it in