Quantcast
Channel: patterns & practices – Enterprise Library
Viewing all 1928 articles
Browse latest View live

New Post: MSMQ Distributor Service (EntLib 5) won't start ... sometimes

$
0
0
The behavior seems very odd. Do you get any exceptions? When you say "it wouldn't run again" what does that mean? That it started but nothing was processed? Is the queue a local queue or remote (to the distributor service)?

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to

New Post: ActivationException Activation error occured while trying to get instance of type ICacheManager, key "Cache Manager"

$
0
0
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
  <section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
</configSections> 
<cachingConfiguration defaultCacheManager="Cache Manager">
<cacheManagers>
  <add name="Cache Manager" type="Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
      expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000"
      numberToRemoveWhenScavenging="10" backingStoreName="NullBackingStore" />
  <add name="Cache Manager" type="Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
      expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000"
      numberToRemoveWhenScavenging="10" backingStoreName="Isolated Storage Cache Store" />
</cacheManagers>

<backingStores>
  <add name="Isolated Storage Cache Store" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.IsolatedStorageBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
      encryptionProviderName="" partitionName="Cache" />
  <add type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    name="NullBackingStore" />
</backingStores>
</cachingConfiguration>__

New Post: MSMQ Distributor Service (EntLib 5) won't start ... sometimes

$
0
0
Hi Randy. Sorry for not putting more useful information in the post!

I've got to try to reproduce it (shouldn't be hard) and I'll send along anything I'm seeing in eventviewer. Anything else I should look for?

What happens is that it eventually times out when trying to restart the service, so it doesn't end up running at all.

The queue is a private queue on the local machine, nothing remote. I have permissions set correctly and all that as when it does get up and running it processes messages off the queue correctly.

Thanks,

Chris

New Post: How to log errors through MSMQ using Logger ?

$
0
0
This is my Configuration for enterprise library. XXErrors is Private Queue created with read and write access for application pool. If I just use log policy then it logs it okay but if i go through custom handler and tries to log through logger class , it starts giving the error message etc.



<configuration>
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
<section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
</configSections>
<loggingConfiguration name="" tracingEnabled="true" defaultCategory="General">
<listeners>
<add name="Event Log Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
source="Enterprise Library Logging" formatter="Text Formatter"
log="" machineName="." traceOutputOptions="None" />
<add name="Message Queuing Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.MsmqTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.MsmqTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
queuePath=".\Private$\XXErrors" formatter="Binary Log Message Formatter"
traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack" />
</listeners>
<formatters>
<add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
template="Timestamp: {timestamp}{newline} Message: {message}{newline} Category: {category}{newline} Priority: {priority}{newline} EventId: {eventid}{newline} Severity: {severity}{newline} Title:{title}{newline} Machine: {localMachine}{newline} App Domain: {localAppDomain}{newline} ProcessId: {localProcessId}{newline} Process Name: {localProcessName}{newline} Thread Name: {threadName}{newline} Win32 ThreadId:{win32ThreadId}{newline} Extended Properties: {dictionary({key} - {value}{newline})}"
name="Text Formatter" />
<add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.BinaryLogFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="Binary Log Message Formatter" />
</formatters>
<categorySources>
<add switchValue="All" name="General">
<listeners>
<add name="Message Queuing Trace Listener" />
</listeners>
</add>
</categorySources>
<specialSources>
<allEvents switchValue="All" name="All Events" />
<notProcessed switchValue="All" name="Unprocessed Category" />
<errors switchValue="All" name="Logging Errors & Warnings">
<listeners>
<add name="Event Log Listener" />
</listeners>
</errors>
</specialSources>
</loggingConfiguration>
<exceptionHandling>
<exceptionPolicies>
<add name="BusinessPolicy">
<exceptionTypes>
<add name="All Exceptions" type="System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
postHandlingAction="ThrowNewException">
<exceptionHandlers>
<add type="Test.Project.ExceptionHandling.CustomHandler.ExceptionHandler, Test.Project.ExceptionHandling.CustomHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
name="ExceptionHandler" />
</exceptionHandlers>
</add>
</exceptionTypes>
</add>
<add name="WCF Exception Shielding">
<exceptionTypes>
<add name="All Exceptions" type="System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
postHandlingAction="ThrowNewException">
<exceptionHandlers>
<add type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF.FaultContractExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
faultContractType="GNL.CapitalWorks.Entities.FaultMessage, GNL.CapitalWorks.Entities.Other, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
name="Fault Contract Exception Handler">
<mappings>
<add source="{Guid}" name="Id" />
<add source="{Message}" name="MessageText" />
</mappings>
</add>
</exceptionHandlers>
</add>
</exceptionTypes>
</add>
<add name="DatabasePolicy">
<exceptionTypes>
<add name="All Exceptions" type="System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
postHandlingAction="NotifyRethrow">
<exceptionHandlers>
<add name="Logging Exception Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
logCategory="General" eventId="100" severity="Error" title="Capital Works"
formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
priority="0" />
<add type="Test.Project.ExceptionHandling.CustomHandler.ExceptionHandler, Test.Project.ExceptionHandling.CustomHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
name="ExceptionHandler" />
</exceptionHandlers>
</add>
</exceptionTypes>
</add>
<add name="LogPolicy">
<exceptionTypes>
<add name="All Exceptions" type="System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
postHandlingAction="ThrowNewException">
<exceptionHandlers>
<add name="Logging Exception Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
logCategory="General" eventId="100" severity="Error" title="Enterprise Library Exception Handling"
formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
priority="0" />
</exceptionHandlers>
</add>
</exceptionTypes>
</add>
</exceptionPolicies>
</exceptionHandling>


New Post: MSMQ Distributor Service (EntLib 5) won't start ... sometimes

$
0
0
An intermittent timeout on startup sounds very odd. Startup doesn't do that much real work -- mostly validation, log some messages and start a timer. If an exception is thrown then that should be logged and the service should fail to start. Definitely check the event log and see what is there.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to

Commented Unassigned: exception of type 'System.Security.VerificationException' occurred in Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database.dll [33761]

$
0
0
This exception happens in the block of code below:
```
SinkSubscription<SqlDatabaseSink> subscription = null;
try
{
//there may be a chance for exception of type 'System.Security.VerificationException'
// occurred in Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database.dll


subscription = sqlListener.LogToSqlDatabase(SqlLogConfigManager.Current.Instance, SqlLogConfigManager.Current.Connection, bufferingInterval: SqlLogConfigManager.Current.BufferingInterval, bufferingCount: SqlLogConfigManager.Current.BufferingCount);
}
catch (Exception error)
{
Trace7.Error(error);
}
```
Here's the stack info:
```
A first chance exception of type 'System.Security.VerificationException' occurred in Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database.dll
WebDev.WebServer40.exe Error: 0 : System.Security.VerificationException: Operation could destabilize the runtime.
at Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.RetryPolicy`1..ctor(Int32 retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Sinks.SqlDatabaseSink..ctor(String instanceName, String connectionString, String tableName, TimeSpan bufferingInterval, Int32 bufferingCount, Int32 maxBufferSize, TimeSpan onCompletedTimeout)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.SqlDatabaseLog.LogToSqlDatabase(IObservable`1 eventStream, String instanceName, String connectionString, String tableName, Nullable`1 bufferingInterval, Int32 bufferingCount, Nullable`1 onCompletedTimeout, Int32 maxBufferSize)
at ProjectP.Log.SemanticLog.MainApplicationEventSource..cctor() in \somepath\Logging\SemanticLog\MainApplicationEventSource.cs:line 60
---- DEBUG ASSERTION FAILED ----
---- Assert Short Message ----
Operation could destabilize the runtime.
---- Assert Long Message ----

at ProjectP.Shared.FxExtension.Trace7.Error(Exception error) in \somepath\Shared\FxExtension\Trace7.cs:line 41
at ProjectP.Log.SemanticLog.MainApplicationEventSource..cctor() in \somepath\Logging\SemanticLog\MainApplicationEventSource.cs:line 68
at ProjectP.WebApp.MainApp.MvcApplication.Application_Start() in \somepath\WebApp\MainApp\Global.asax.cs:line 17
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Web.HttpApplication.InvokeMethodWithAssert(MethodInfo method, Int32 paramCount, Object eventSource, EventArgs eventArgs)
at System.Web.HttpApplication.ProcessSpecialRequest(HttpContext context, MethodInfo method, Int32 paramCount, Object eventSource, EventArgs eventArgs, HttpSessionState session)
at System.Web.HttpApplicationFactory.FireApplicationOnStart(HttpContext context)
at System.Web.HttpApplicationFactory.EnsureAppStartCalled(HttpContext context)
at System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context)
at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
at System.Web.HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
at System.Web.HttpRuntime.ProcessRequest(HttpWorkerRequest wr)
at Microsoft.VisualStudio.WebHost.Request.Process()
at Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Connection conn)
```
All configuration and unit tests (using EventSourceAnalyzer.InspectAll) have no problems.
An article online suggested to disable IntelliTrace but I could not find it in my Visual Studio 2012 edition.

Comments: Since the error did not happen on the server, I comment it out from my local machine. Yesterday I had to turn it back on the the issue is coming back. I checked this forum again and saw the patch for Windows 7 (randylevy wrote Jun 14 at 11:48 AM) I am installing the patch and it's working now. Thank you for the link

Commented Unassigned: exception of type 'System.Security.VerificationException' occurred in Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database.dll [33761]

$
0
0
This exception happens in the block of code below:
```
SinkSubscription<SqlDatabaseSink> subscription = null;
try
{
//there may be a chance for exception of type 'System.Security.VerificationException'
// occurred in Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database.dll


subscription = sqlListener.LogToSqlDatabase(SqlLogConfigManager.Current.Instance, SqlLogConfigManager.Current.Connection, bufferingInterval: SqlLogConfigManager.Current.BufferingInterval, bufferingCount: SqlLogConfigManager.Current.BufferingCount);
}
catch (Exception error)
{
Trace7.Error(error);
}
```
Here's the stack info:
```
A first chance exception of type 'System.Security.VerificationException' occurred in Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database.dll
WebDev.WebServer40.exe Error: 0 : System.Security.VerificationException: Operation could destabilize the runtime.
at Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.RetryPolicy`1..ctor(Int32 retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Sinks.SqlDatabaseSink..ctor(String instanceName, String connectionString, String tableName, TimeSpan bufferingInterval, Int32 bufferingCount, Int32 maxBufferSize, TimeSpan onCompletedTimeout)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.SqlDatabaseLog.LogToSqlDatabase(IObservable`1 eventStream, String instanceName, String connectionString, String tableName, Nullable`1 bufferingInterval, Int32 bufferingCount, Nullable`1 onCompletedTimeout, Int32 maxBufferSize)
at ProjectP.Log.SemanticLog.MainApplicationEventSource..cctor() in \somepath\Logging\SemanticLog\MainApplicationEventSource.cs:line 60
---- DEBUG ASSERTION FAILED ----
---- Assert Short Message ----
Operation could destabilize the runtime.
---- Assert Long Message ----

at ProjectP.Shared.FxExtension.Trace7.Error(Exception error) in \somepath\Shared\FxExtension\Trace7.cs:line 41
at ProjectP.Log.SemanticLog.MainApplicationEventSource..cctor() in \somepath\Logging\SemanticLog\MainApplicationEventSource.cs:line 68
at ProjectP.WebApp.MainApp.MvcApplication.Application_Start() in \somepath\WebApp\MainApp\Global.asax.cs:line 17
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Web.HttpApplication.InvokeMethodWithAssert(MethodInfo method, Int32 paramCount, Object eventSource, EventArgs eventArgs)
at System.Web.HttpApplication.ProcessSpecialRequest(HttpContext context, MethodInfo method, Int32 paramCount, Object eventSource, EventArgs eventArgs, HttpSessionState session)
at System.Web.HttpApplicationFactory.FireApplicationOnStart(HttpContext context)
at System.Web.HttpApplicationFactory.EnsureAppStartCalled(HttpContext context)
at System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context)
at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
at System.Web.HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
at System.Web.HttpRuntime.ProcessRequest(HttpWorkerRequest wr)
at Microsoft.VisualStudio.WebHost.Request.Process()
at Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Connection conn)
```
All configuration and unit tests (using EventSourceAnalyzer.InspectAll) have no problems.
An article online suggested to disable IntelliTrace but I could not find it in my Visual Studio 2012 edition.

Comments: How do I mark this issue as resolved? Just curious for future use of this forum.

New Post: ActivationException Activation error occured while trying to get instance of type ICacheManager, key "Cache Manager"

$
0
0
The above configuration has 2 cache managers called "Cache Manager". This should result in the error The entry 'Cache Manager' has already been added.

If I change one of the CacheManager names then I can resolve properly.

You didn't post any code so...I'm guessing maybe you are doing something like this?
var cacheManager = EnterpriseLibraryContainer.Current.GetInstance<CacheManager>();
ICacheManager should be the type to use to retrieve a cache manager:
    ICacheManager cacheManager = EnterpriseLibraryContainer.Current.GetInstance<ICacheManager>();
~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to

New Post: Enterprise Library 6.0 WCF Exception Handling Shielding Exception is not working

$
0
0
Thanks Randy

It is working once adding Global.asax file and your code and Entlib changes on the WCF service . But is there any work around avoid adding Global.asax in the WCF service. Please advise

New Post: EntLib Exception Logging: wrong time

$
0
0
Hi...

I used EntLib Exception and Logging Block, but the time in log file doesn't represent now time

Log:

7/27/2013 7:39:21 AM
Exception
HandlingInstanceID: 32475e39-86fc-4ca9-a838-9a993fdf6193

An exception of type 'MySql.Data.MySqlClient.MySqlException' occurred and was caught.

07/27/2013 07:39:21
Type : MySql.Data.MySqlClient.MySqlException, MySql.Data, Version=6.6.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d
Message : Unable to connect to any of the specified MySQL hosts.
Source : MySql.Data
Help link :
Number : 1042
ErrorCode : -2147467259
Data : System.Collections.ListDictionaryInternal
TargetSite : Void Open()
HResult : -2147467259
Stack Trace : at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at GTMP.MiddleTier.DAL.PointsTransactionDAL.GetPointsTransactionsFromMySQLByDateRange2(DateTime startdate, DateTime endDate) in D:\Projects\VS2010\GoTronikMemberPoint\GTMP.MiddleTier.DAL\PointsTransactionDAL.cs:line 339

Additional Info:

MachineName : ALPHACOM
TimeStamp : 7/27/2013 12:39:21 AM
FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
AppDomainName : GTMP.PresentationTier.Con.vshost.exe
ThreadIdentity :

WindowsIdentity : ******

as you can see TimeStamp in Additional Info doesn't represent current time (7:39:21 AM)
I already add (local) in my timespan

New Post: EntLib Exception Logging: wrong time

$
0
0
The Logging Application Block allows you to control the format of time stamps via the template. However, when using the Exception Handling Application Block the Message property of the LogEntry is formatted using an ExceptionFormatter (the default being the TextExceptionFormatter). The default ExceptionFormatter behavior uses DateTime.UtcNow for setting the Additional Info TimeStamp property so it is not possible to change using configuration.

Unfortunately, if you want to customize the format of the Message property set by the Exception Handling Application Block then you would have to create a custom ExceptionFormatter.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to

New Post: SemanticLogging-svc logging to SQLExpress Column Mapping does not match

$
0
0
I think you maybe be using/referring to the preview release because as far as I can see sqlDatabaseEventListener does not exist in the production release. I believe that the term listener was changed to sink during development (which brings us full circle in a way). In terms of the schema the final release schema fully supports sinks as well as sqlDatabaseSink.

If you are using the CTP release then I would definitely recommend moving to the RTM release.

For example here is my config file based on the latest release:
<?xmlversion="1.0"encoding="utf-8"?><configurationxmlns="http://schemas.microsoft.com/practices/2013/entlib/semanticlogging/etw"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://schemas.microsoft.com/practices/2013/entlib/semanticlogging/etw SemanticLogging-svc.xsd"><!-- Optional settings for fine tuning performance and Trace Event Session identification--><traceEventService/><!-- Sinks reference definitons used by this host to listen ETW events --><sinks><sqlDatabaseSinkname="sqlDB"bufferingCount="0"bufferingFlushAllTimeoutInSeconds="0"bufferingIntervalInSeconds="0"connectionString="Database=SLAB;Server=(local)\SQLEXPRESS;Integrated Security=SSPI;"instanceName="Demo Semantic Logging ETW Instance"><sources><eventSourcename="MyEventSource"level="LogAlways"/></sources></sqlDatabaseSink><!-- The service identity should have security permissions to access the resource according to each event sink --><flatFileSinkname="svcRuntime"fileName="SemanticLogging-svc.runtime.log"><sources><!-- The below settings shows a simple configuration sample for the buit-in non-transient fault tracing --><!-- Remove this eventSource if you'd like, and add your own configuration according to the documentation --><!-- The name attribute is from the EventSource.Name Property --><eventSourcename="Microsoft-SemanticLogging"level="Warning"/></sources><!--[Add any built-in or custom formatter here if the sink supports text formatters]--><eventTextFormatterheader="----------"/></flatFileSink><!--[Add any built-in or custom sink definition here]--></sinks></configuration>
Instance name can be whatever you want it to be. Usually it would be something related to your application. The main use I can see is if you have multiple "servers" in a farm (e.g. using Windows Azure). Then you could use instanceName to identify the specific application instance that generated the log entry.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to

New Post: Enterprise Library 6.0 WCF Exception Handling Shielding Exception is not working

Updated Wiki: Home

$
0
0
The new Semantic Logging Application Block CTP is out! Get it now

The Microsoft Enterprise Library is a collection of reusable software components (application blocks) designed to assist software developers with common enterprise development challenges. Application blocks are provided as source code plus documentation that can be used "as is," extended, or modified by developers to use on complex, enterprise-level line-of-business development projects.

DOWNLOADOfficial releasesPREVIEWCurrent Roadmap, Past Roadmaps
Current release - April 2013 (Enterprise Library 6), Windows Azure Integration Pack - Nov 2011, Previous releases
Standalone Unity, Unity 2.1 - Aug 2012 Update, Unity 3.0new.png Follow @mspnp, @gmelnik and the #entlib hashtag
LEARNHands-on LabsGET SUPPORTDiscussion Forum
EntLib6 Developer's GuideIssue Tracker
Videos, Webcast DemosSupport How-to
EntLib FAQSample Projects
Reference documentationEntLib6 Sample Projects
CONTRIBUTE Share extensions via EntLibContrib Project (Jan 2010 Release)PROVIDE FEEDBACKEntLib satisfaction survey
Hosting your extension in your own CodePlex project? Tag it with Enterprise LibrarySubmit suggestions
Report bugs


News

 Grigori Melnik: Thoughts on Agile Software Engineering and Beyond : Enterprise Library News Feed 
 Grigori Melnik: Thoughts on Agile Software Engineering and Beyond : Enterprise Library News Feed 


patterns & practices Links

Updated Wiki: Previous releases


New Post: EntLib Exception Logging: wrong time

$
0
0
So it is the default ExceptionFormatter, thank you for your information randylevy

New Post: Layered Exception

$
0
0
Hi all..

I'm new in Development environment.I want Handle and Store the Exception in Database.

In My project 4 layers available.(DA,BL,R,F).I handle the exceptions in 4 layers.


I want handle the error in layer wise.any error occurred in any one layer that error is not throwing another layer.

How to do in Enterprise library?

Commented Unassigned: exception of type 'System.Security.VerificationException' occurred in Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database.dll [33761]

$
0
0
This exception happens in the block of code below:
```
SinkSubscription<SqlDatabaseSink> subscription = null;
try
{
//there may be a chance for exception of type 'System.Security.VerificationException'
// occurred in Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database.dll


subscription = sqlListener.LogToSqlDatabase(SqlLogConfigManager.Current.Instance, SqlLogConfigManager.Current.Connection, bufferingInterval: SqlLogConfigManager.Current.BufferingInterval, bufferingCount: SqlLogConfigManager.Current.BufferingCount);
}
catch (Exception error)
{
Trace7.Error(error);
}
```
Here's the stack info:
```
A first chance exception of type 'System.Security.VerificationException' occurred in Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database.dll
WebDev.WebServer40.exe Error: 0 : System.Security.VerificationException: Operation could destabilize the runtime.
at Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.RetryPolicy`1..ctor(Int32 retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Sinks.SqlDatabaseSink..ctor(String instanceName, String connectionString, String tableName, TimeSpan bufferingInterval, Int32 bufferingCount, Int32 maxBufferSize, TimeSpan onCompletedTimeout)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.SqlDatabaseLog.LogToSqlDatabase(IObservable`1 eventStream, String instanceName, String connectionString, String tableName, Nullable`1 bufferingInterval, Int32 bufferingCount, Nullable`1 onCompletedTimeout, Int32 maxBufferSize)
at ProjectP.Log.SemanticLog.MainApplicationEventSource..cctor() in \somepath\Logging\SemanticLog\MainApplicationEventSource.cs:line 60
---- DEBUG ASSERTION FAILED ----
---- Assert Short Message ----
Operation could destabilize the runtime.
---- Assert Long Message ----

at ProjectP.Shared.FxExtension.Trace7.Error(Exception error) in \somepath\Shared\FxExtension\Trace7.cs:line 41
at ProjectP.Log.SemanticLog.MainApplicationEventSource..cctor() in \somepath\Logging\SemanticLog\MainApplicationEventSource.cs:line 68
at ProjectP.WebApp.MainApp.MvcApplication.Application_Start() in \somepath\WebApp\MainApp\Global.asax.cs:line 17
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Web.HttpApplication.InvokeMethodWithAssert(MethodInfo method, Int32 paramCount, Object eventSource, EventArgs eventArgs)
at System.Web.HttpApplication.ProcessSpecialRequest(HttpContext context, MethodInfo method, Int32 paramCount, Object eventSource, EventArgs eventArgs, HttpSessionState session)
at System.Web.HttpApplicationFactory.FireApplicationOnStart(HttpContext context)
at System.Web.HttpApplicationFactory.EnsureAppStartCalled(HttpContext context)
at System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context)
at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
at System.Web.HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
at System.Web.HttpRuntime.ProcessRequest(HttpWorkerRequest wr)
at Microsoft.VisualStudio.WebHost.Request.Process()
at Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Connection conn)
```
All configuration and unit tests (using EventSourceAnalyzer.InspectAll) have no problems.
An article online suggested to disable IntelliTrace but I could not find it in my Visual Studio 2012 edition.

Comments: Thanks for the update. The issue has to be marked as resolved by the coordinators of the group, so I'll do that now.

Closed Unassigned: exception of type 'System.Security.VerificationException' occurred in Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database.dll [33761]

$
0
0
This exception happens in the block of code below:
```
SinkSubscription<SqlDatabaseSink> subscription = null;
try
{
//there may be a chance for exception of type 'System.Security.VerificationException'
// occurred in Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database.dll


subscription = sqlListener.LogToSqlDatabase(SqlLogConfigManager.Current.Instance, SqlLogConfigManager.Current.Connection, bufferingInterval: SqlLogConfigManager.Current.BufferingInterval, bufferingCount: SqlLogConfigManager.Current.BufferingCount);
}
catch (Exception error)
{
Trace7.Error(error);
}
```
Here's the stack info:
```
A first chance exception of type 'System.Security.VerificationException' occurred in Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database.dll
WebDev.WebServer40.exe Error: 0 : System.Security.VerificationException: Operation could destabilize the runtime.
at Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.RetryPolicy`1..ctor(Int32 retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Sinks.SqlDatabaseSink..ctor(String instanceName, String connectionString, String tableName, TimeSpan bufferingInterval, Int32 bufferingCount, Int32 maxBufferSize, TimeSpan onCompletedTimeout)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.SqlDatabaseLog.LogToSqlDatabase(IObservable`1 eventStream, String instanceName, String connectionString, String tableName, Nullable`1 bufferingInterval, Int32 bufferingCount, Nullable`1 onCompletedTimeout, Int32 maxBufferSize)
at ProjectP.Log.SemanticLog.MainApplicationEventSource..cctor() in \somepath\Logging\SemanticLog\MainApplicationEventSource.cs:line 60
---- DEBUG ASSERTION FAILED ----
---- Assert Short Message ----
Operation could destabilize the runtime.
---- Assert Long Message ----

at ProjectP.Shared.FxExtension.Trace7.Error(Exception error) in \somepath\Shared\FxExtension\Trace7.cs:line 41
at ProjectP.Log.SemanticLog.MainApplicationEventSource..cctor() in \somepath\Logging\SemanticLog\MainApplicationEventSource.cs:line 68
at ProjectP.WebApp.MainApp.MvcApplication.Application_Start() in \somepath\WebApp\MainApp\Global.asax.cs:line 17
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Web.HttpApplication.InvokeMethodWithAssert(MethodInfo method, Int32 paramCount, Object eventSource, EventArgs eventArgs)
at System.Web.HttpApplication.ProcessSpecialRequest(HttpContext context, MethodInfo method, Int32 paramCount, Object eventSource, EventArgs eventArgs, HttpSessionState session)
at System.Web.HttpApplicationFactory.FireApplicationOnStart(HttpContext context)
at System.Web.HttpApplicationFactory.EnsureAppStartCalled(HttpContext context)
at System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context)
at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
at System.Web.HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
at System.Web.HttpRuntime.ProcessRequest(HttpWorkerRequest wr)
at Microsoft.VisualStudio.WebHost.Request.Process()
at Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Connection conn)
```
All configuration and unit tests (using EventSourceAnalyzer.InspectAll) have no problems.
An article online suggested to disable IntelliTrace but I could not find it in my Visual Studio 2012 edition.

Edited Unassigned: exception of type 'System.Security.VerificationException' occurred in Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database.dll [33761]

$
0
0
This exception happens in the block of code below:
```
SinkSubscription<SqlDatabaseSink> subscription = null;
try
{
//there may be a chance for exception of type 'System.Security.VerificationException'
// occurred in Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database.dll


subscription = sqlListener.LogToSqlDatabase(SqlLogConfigManager.Current.Instance, SqlLogConfigManager.Current.Connection, bufferingInterval: SqlLogConfigManager.Current.BufferingInterval, bufferingCount: SqlLogConfigManager.Current.BufferingCount);
}
catch (Exception error)
{
Trace7.Error(error);
}
```
Here's the stack info:
```
A first chance exception of type 'System.Security.VerificationException' occurred in Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Database.dll
WebDev.WebServer40.exe Error: 0 : System.Security.VerificationException: Operation could destabilize the runtime.
at Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.RetryPolicy`1..ctor(Int32 retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Sinks.SqlDatabaseSink..ctor(String instanceName, String connectionString, String tableName, TimeSpan bufferingInterval, Int32 bufferingCount, Int32 maxBufferSize, TimeSpan onCompletedTimeout)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.SqlDatabaseLog.LogToSqlDatabase(IObservable`1 eventStream, String instanceName, String connectionString, String tableName, Nullable`1 bufferingInterval, Int32 bufferingCount, Nullable`1 onCompletedTimeout, Int32 maxBufferSize)
at ProjectP.Log.SemanticLog.MainApplicationEventSource..cctor() in \somepath\Logging\SemanticLog\MainApplicationEventSource.cs:line 60
---- DEBUG ASSERTION FAILED ----
---- Assert Short Message ----
Operation could destabilize the runtime.
---- Assert Long Message ----

at ProjectP.Shared.FxExtension.Trace7.Error(Exception error) in \somepath\Shared\FxExtension\Trace7.cs:line 41
at ProjectP.Log.SemanticLog.MainApplicationEventSource..cctor() in \somepath\Logging\SemanticLog\MainApplicationEventSource.cs:line 68
at ProjectP.WebApp.MainApp.MvcApplication.Application_Start() in \somepath\WebApp\MainApp\Global.asax.cs:line 17
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Web.HttpApplication.InvokeMethodWithAssert(MethodInfo method, Int32 paramCount, Object eventSource, EventArgs eventArgs)
at System.Web.HttpApplication.ProcessSpecialRequest(HttpContext context, MethodInfo method, Int32 paramCount, Object eventSource, EventArgs eventArgs, HttpSessionState session)
at System.Web.HttpApplicationFactory.FireApplicationOnStart(HttpContext context)
at System.Web.HttpApplicationFactory.EnsureAppStartCalled(HttpContext context)
at System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context)
at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
at System.Web.HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
at System.Web.HttpRuntime.ProcessRequest(HttpWorkerRequest wr)
at Microsoft.VisualStudio.WebHost.Request.Process()
at Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Connection conn)
```
All configuration and unit tests (using EventSourceAnalyzer.InspectAll) have no problems.
An article online suggested to disable IntelliTrace but I could not find it in my Visual Studio 2012 edition.

Viewing all 1928 articles
Browse latest View live