enterprise-library

Enterprise Library 5.0 - Application Logging - Incorrect DateTime

匆匆过客 提交于 2019-11-30 00:59:12
问题 I am using Microsoft Enterprise library 5.0 for application logging of my .net application. Logging is working properly. But the problem is the DateTime that is being logged along with the logging message is incorrect. There is a time difference of 6.5 hrs. How can i correct this? 回答1: Change your text formatter (in app.config) to use the local server time, otherwise it defaults to UTC. e.g. change {timestamp} token to {timestamp(local)} 回答2: Changing in the config file will just reflect in

Setting parameter to DBNull.Value using ternary syntax gives error?

十年热恋 提交于 2019-11-30 00:48:32
问题 I have the following bit of code to set a parameter that will be used in an INSERT statement to set a VARCHAR column in a SQL Server database. My value object (named ilo) has a property called Description that gets initialized to String.Empty, and then either gets set to some value read from XML, or if that XML element is empty it just stays as String.Empty. So when inserting into the database, if the property is still set to String.Empty, I'd like to have it insert a null value. database

Change Timestamp value in enterprise library exception handling formatter

匆匆过客 提交于 2019-11-29 15:10:37
I am using enterprize library 5.0 with c# for exception handling and for that I am using formatter.Now In my log file Timestamp is not giving the right time. Can I change the value of timestamp in formatter. Timestamp: {timestamp(local)} will get the local system time The timestamp entry uses UTC so that exceptions logged in different timezones can be correlated. The best idea is to convert the time to local if and when you read the trace log file and present the information to the user. 来源: https://stackoverflow.com/questions/2972451/change-timestamp-value-in-enterprise-library-exception

Format of the initialization string does not conform to to specification starting at index 0

谁说我不能喝 提交于 2019-11-29 13:42:27
I am using Microsoft Enterprise Lip I I have this method to Insert resource in the website I get this error down i don't think it is permission problem and really i don't know how to solve it.by the way I test the connectionStrings and it work fine <connectionStrings> <add name="SiteSqlServer" connectionString="Data Source=.;Initial Catalog=databaseName;User ID=sa;Password=***"/> </connectionStrings> public static int Insert(Resoursce r) { Database objDB = new SqlDatabase("SiteSqlServer"); int val = 0; using (DbCommand cmd = objDB.GetStoredProcCommand("InsertResoursce")) { // OutParameter

Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common' or one of its dependencies

自古美人都是妖i 提交于 2019-11-29 05:46:37
I have searched google for this and could not find the solution to the problem. My Website references DAL (custom dll) which references Enterprise Library Data Access Components. I have added the Enterprise Library from the NuGet Package Manager and when I try to build the Website this compilation error pops up: Error 44 Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference I have tried setting the Copy Local = True in the DAL for the Enterprise Library dlls and

Implementing Log file using Enterprise Library in asp.net

僤鯓⒐⒋嵵緔 提交于 2019-11-29 02:41:54
I m using Microsoft Enterprise Library 3.1 for Exception Handling in asp.net, the erors are stored in Event Viewer of the system . Instead of Event Viewer I need to store these errors in a log File using Enterprise Library. Dear 2:30, You paste the following code inside configuration section at app.config or web.config file <configSections> <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null" /> <section name="dataConfiguration

Changing connection string at runtime in Enterprise Library

点点圈 提交于 2019-11-29 02:17:15
Is there a way to change the connection string of a DataBase object in Enterprise Library at runtime? I've found this link but its a little bit outdated (2005) I've also found this but it seems to apply to .Net in general, I was wondering if there was something that could be done specifically for EntLib. I was just passing the connection string name to the CreateDatabase() method in DatabaseFactory object and that worked til yesterday that my project manager asked me to support more than one database instance. It happens that we have to have one database per state (one for CA, one for FL, etc.

How To Use Exception Manager Enterprise Library 6.0

孤人 提交于 2019-11-29 01:14:02
问题 When using Enterprise Library 6.0, this error occurs in the code below: bool rethrow = ExceptionPolicy.HandleException(ex, "ReplacePolicy1") "Must set an ExceptionManager in the ExceptionPolicy class using the SetExceptionManager method." In Enterprise Library 5.0 this code worked: public static bool HandleException(Exception exception, string PolicyName) { ExceptionManager exManager = EnterpriseLibraryContainer.Current.GetInstance<ExceptionManager>(); ExceptionPolicy.SetExceptionManager

Format of the initialization string does not conform to to specification starting at index 0

坚强是说给别人听的谎言 提交于 2019-11-28 07:36:57
问题 I am using Microsoft Enterprise Lip I I have this method to Insert resource in the website I get this error down i don't think it is permission problem and really i don't know how to solve it.by the way I test the connectionStrings and it work fine <connectionStrings> <add name="SiteSqlServer" connectionString="Data Source=.;Initial Catalog=databaseName;User ID=sa;Password=***"/> </connectionStrings> public static int Insert(Resoursce r) { Database objDB = new SqlDatabase("SiteSqlServer");

VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products

二次信任 提交于 2019-11-28 07:20:07
问题 I tried to install enterprise library 6.0 recently in visual studio 2015 but the installer throws an error 'VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products'. I couldn't resolve it. 19-Dec-16 9:59:48 AM - Microsoft VSIX Installer 19-Dec-16 9:59:48 AM - ------------------------------------------- 19-Dec-16 9:59:48 AM - Initializing Install... 19-Dec-16 9:59:48 AM - Extension Details... 19-Dec-16 9:59:48 AM - Identifier : A42E118F