I haven't noticed that. When using the RollingFlatFileSink OOP the sink will be used in synchronous mode which should cause entries to be flushed when received. Perhaps you are having issues with the log file being locked until it is rolled or the service is shutdown.
↧
New Post: Semantic Logging - RollingFlatFileSink - Real-Time Logging
↧
New Post: Invalid Cast Exception: Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings casting conflict
Hello,
I am working with an application which uses Enterprise Library 5.0.505.0. and our application references a third-party vendor solution which relies on Enterprise Library 3.1.0.0. Whenever the vendor solution tries to log something, we receive this exception.
I understand that the easiest solution is to have both our application and the vendor both running the same version of the EntLib, however, that is not a possibility.
Looking for a brief explanation of why this problem is occurring (why the vendor is trying to cast a 5.0 object to a 3.1 object) and any possible resolutions for either side.
Thank you,
Gerald
I am working with an application which uses Enterprise Library 5.0.505.0. and our application references a third-party vendor solution which relies on Enterprise Library 3.1.0.0. Whenever the vendor solution tries to log something, we receive this exception.
Message: HandlingInstanceID: faec4655-7093-412f-91ea-60486b89bdac
An exception of type 'System.InvalidCastException' occurred and was caught.
---------------------------------------------------------------------------
01/28/2015 13:49:06
Type : System.InvalidCastException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : [A]Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings cannot be cast to [B]Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings. Type A originates from 'Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'T:\..........\EntLib5\Microsoft.Practices.EnterpriseLibrary.Logging.dll'. Type B originates from 'Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=64de8a15871beee6' in the context 'Default' at location 'C:\Windows\assembly\GAC_MSIL\Microsoft.Practices.EnterpriseLibrary.Logging\3.1.0.0__64de8a15871beee6\Microsoft.Practices.EnterpriseLibrary.Logging.dll'.
Source : Microsoft.Practices.EnterpriseLibrary.Logging
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings GetLoggingSettings(Microsoft.Practices.EnterpriseLibrary.Common.Configuration.IConfigurationSource)
HResult : -2147467262
Stack Trace : at Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings.GetLoggingSettings(IConfigurationSource configurationSource)
at Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterStructureHolderCustomFactory.CreateObject(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache)
at Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterCustomFactory.CreateObject(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id)
at Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild)
at Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfigurationNameMappingStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id)
at Microsoft.Practices.ObjectBuilder.BuilderBase`1.DoBuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies)
at Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies)
at Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp[TTypeToBuild](IReadWriteLocator locator, String idToBuild, Object existing, PolicyList[] transientPolicies)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](IReadWriteLocator locator, IConfigurationSource configurationSource)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](IConfigurationSource configurationSource)
at Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterFactory.Create()
at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.get_Writer()
at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(LogEntry log)
at Afs.Direct.Branch.Diagnostics.Trace(TraceSourceType source, String message, TraceEventType severity, Dictionary`2 traceProperties)
at Afs.Direct.Branch.BCTraceListener.WriteLine(String message, String category)
at System.Diagnostics.TraceInternal.WriteLine(String message, String category)
at Afs.Direct.CaptureInterop.ApiAuditor.LogMessageVerbose(String message)
at Afs.Direct.CaptureInterop.Client.DirectClientManager..ctor()
at Services.ChequeScannerService.initialize()
The loggingConfiguration in our app.config file looks like so:<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true"/>
and for the vendor it looks like:<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging"/>
I have tried editing the vendor config file to refer to the specific version of the enterprise library with no luck. I have tried bindingRedirect also with no success.I understand that the easiest solution is to have both our application and the vendor both running the same version of the EntLib, however, that is not a possibility.
Looking for a brief explanation of why this problem is occurring (why the vendor is trying to cast a 5.0 object to a 3.1 object) and any possible resolutions for either side.
Thank you,
Gerald
↧
↧
New Post: Getting started with the Enterprise Library v5.0, and getting an error when trying to use the createdatabase function
Hi all, I am trying to use the CreateDatabase function using the name of one of the databases that I have in my app.config file. However, I keep getting an error:
Activation error occured while trying to get instance of type Database, key
The inner exception is
Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Data.Database", name = "MYDBEntities".
Exception occurred while: while resolving.
Resolving Microsoft.Practices.EnterpriseLibrary.Data.Database,MYDBEntities
in my app.config file I do have an entry for this database that states:
<add name="MYDBEntities" connectionString="metadata=res:///PredictionModel.csdl|res:///PredictionModel.ssdl|res://*/PredictionModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=SQLDEV01\SQLDEV02;Initial Catalog=ADPREDICTION;Persist Security Info=True;Connection Timeout=120;Trusted_Connection=Yes;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
The code that I use to create this using the enterprise library is:
Thanks!
Activation error occured while trying to get instance of type Database, key
The inner exception is
Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Data.Database", name = "MYDBEntities".
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The type Database cannot be constructed. You must configure the container to supply this value.
At the time of the exception, the container was:Resolving Microsoft.Practices.EnterpriseLibrary.Data.Database,MYDBEntities
in my app.config file I do have an entry for this database that states:
<add name="MYDBEntities" connectionString="metadata=res:///PredictionModel.csdl|res:///PredictionModel.ssdl|res://*/PredictionModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=SQLDEV01\SQLDEV02;Initial Catalog=ADPREDICTION;Persist Security Info=True;Connection Timeout=120;Trusted_Connection=Yes;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
The code that I use to create this using the enterprise library is:
Database mdb = DatabaseFactory.CreateDatabase("MYDBEntities");
Can someone help me out with this? I have been searching the internet, and applying the recommendations, but I have not had any progress.Thanks!
↧
New Post: Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder and ICustomFactory in Enterpriselibrary 6.0
I am using version 3 of EL and have below class which part of a code generator.
internal class DbSchemaProviderFactory : ICustomFactory
{
public object CreateObject(IBuilderContext context, string name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache)
{
}
}
It used a namespace Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder and also a type ICustomFactory. But once upgraded to EL 6.0, both namespace and type are not available. Please let me know about any alternatives.↧
New Post: DatabaseFactory.CreateDatabase problem in DAAB 6.0
I am having the same issues with DatabaseFactory. Where in the code or in the app.config do I add it?
Presently, I have it in one of my DAL class, compile it, only to tell me "InnerException: The static DatabaseFactory already has a database provider factory or custom methods set". So when I delete it out again, it keeps telling me the database provider factory is not set.
I cannot get help anywhere else. I posted here already. Please help!!
https://daab.codeplex.com/discussions/578950
Presently, I have it in one of my DAL class, compile it, only to tell me "InnerException: The static DatabaseFactory already has a database provider factory or custom methods set". So when I delete it out again, it keeps telling me the database provider factory is not set.
I cannot get help anywhere else. I posted here already. Please help!!
https://daab.codeplex.com/discussions/578950
↧
↧
New Post: Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder and ICustomFactory in Enterpriselibrary 6.0
Any updates?
↧
New Post: Semantic Logging - RollingFlatFileSink - Real-Time Logging
We're still seeing this issue after trying several permutations.
All EventSourceAnalyzer.InspectAlls pass
We've tried running the service in the console with flat files and rolling files
We've tried running the service as a windows service under local service account, flat files and rolling files
We've tried running the service as a windows service under system account, flat files and rolling files
The directory where the log files are places have full permissions for both local service account and system account
When the service is started, the files cannot be deleted with an error: "The action can't be completed because the file is open in Enterprise Library....."
We've redownloaded the semantic logging out of process service, grabbed the updates and reinstalled the service on the server.
The worst part is this all works on my computer at home when I go through the process and use the service started in a console. I know this should work but am running out of ideas.
All EventSourceAnalyzer.InspectAlls pass
We've tried running the service in the console with flat files and rolling files
We've tried running the service as a windows service under local service account, flat files and rolling files
We've tried running the service as a windows service under system account, flat files and rolling files
The directory where the log files are places have full permissions for both local service account and system account
When the service is started, the files cannot be deleted with an error: "The action can't be completed because the file is open in Enterprise Library....."
We've redownloaded the semantic logging out of process service, grabbed the updates and reinstalled the service on the server.
The worst part is this all works on my computer at home when I go through the process and use the service started in a console. I know this should work but am running out of ideas.
↧
New Post: Semantic Logging - RollingFlatFileSink - Real-Time Logging
Here are some interesting items in the event viewer when installing the service:
EventId : 805, Level : Warning, Message : The configuration was partially successfully loaded. Check logs for further error details., Payload : , EventName : TraceEventServiceConfigurationWithFaultsInfo, Timestamp : 2015-02-03T16:54:06.0236143Z, ProcessId : 5960, ThreadId : 5528
ProviderId : d1ed7ec7-5701-5554-2c5e-796dc42511c5
EventId : 803
Keywords : 4
Level : Error
Message : A fault was detected while processing the configuration for the element 'RollingFlatFileSink'. Message: System.UnauthorizedAccessException: Access to the registry key 'HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Winevt\Publishers{659518be-d338-564b-2759-c63c10ef82e2}' is denied.
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.CreateSubKeyInternal(String subkey, RegistryKeyPermissionCheck permissionCheck, Object registrySecurityObj, RegistryOptions registryOptions)
at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck)
at Microsoft.Win32.Registry.SetValue(String keyName, String valueName, Object value, RegistryValueKind valueKind)
at Microsoft.Diagnostics.Tracing.Session.TraceEventSession.SetFilterDataForEtwSession(String providerGuid, Byte[] data, Boolean V4_5EventSource)
at Microsoft.Diagnostics.Tracing.Session.TraceEventSession.EnableProvider(Guid providerGuid, TraceEventLevel providerLevel, UInt64 matchAnyKeywords, TraceEventProviderOptions options)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.Utility.TraceEventUtil.EnableProvider(TraceEventSession session, Guid providerId, EventLevel level, EventKeywords matchAnyKeyword, IEnumerable
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventServiceWorker.Initialize()
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventService.<>c__DisplayClass6.<AddWorkers>b__2()
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventService.HandleException(String callerName, Action body)
Opcode : Info
Task : 64731
Version : 0
Payload : [faultedElement : RollingFlatFileSink] [message : System.UnauthorizedAccessException: Access to the registry key 'HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Winevt\Publishers{659518be-d338-564b-2759-c63c10ef82e2}' is denied.
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.CreateSubKeyInternal(String subkey, RegistryKeyPermissionCheck permissionCheck, Object registrySecurityObj, RegistryOptions registryOptions)
at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck)
at Microsoft.Win32.Registry.SetValue(String keyName, String valueName, Object value, RegistryValueKind valueKind)
at Microsoft.Diagnostics.Tracing.Session.TraceEventSession.SetFilterDataForEtwSession(String providerGuid, Byte[] data, Boolean V4_5EventSource)
at Microsoft.Diagnostics.Tracing.Session.TraceEventSession.EnableProvider(Guid providerGuid, TraceEventLevel providerLevel, UInt64 matchAnyKeywords, TraceEventProviderOptions options)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.Utility.TraceEventUtil.EnableProvider(TraceEventSession session, Guid providerId, EventLevel level, EventKeywords matchAnyKeyword, IEnumerable
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventServiceWorker.Initialize()
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventService.<>c__DisplayClass6.<AddWorkers>b__2()
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventService.HandleException(String callerName, Action body)]
EventName : TraceEventServiceConfigurationFaultInfo
Timestamp : 2015-02-03T16:54:05.9923297Z
ProcessId : 5960
ThreadId : 5528
EventId : 805, Level : Warning, Message : The configuration was partially successfully loaded. Check logs for further error details., Payload : , EventName : TraceEventServiceConfigurationWithFaultsInfo, Timestamp : 2015-02-03T16:54:06.0236143Z, ProcessId : 5960, ThreadId : 5528
ProviderId : d1ed7ec7-5701-5554-2c5e-796dc42511c5
EventId : 803
Keywords : 4
Level : Error
Message : A fault was detected while processing the configuration for the element 'RollingFlatFileSink'. Message: System.UnauthorizedAccessException: Access to the registry key 'HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Winevt\Publishers{659518be-d338-564b-2759-c63c10ef82e2}' is denied.
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.CreateSubKeyInternal(String subkey, RegistryKeyPermissionCheck permissionCheck, Object registrySecurityObj, RegistryOptions registryOptions)
at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck)
at Microsoft.Win32.Registry.SetValue(String keyName, String valueName, Object value, RegistryValueKind valueKind)
at Microsoft.Diagnostics.Tracing.Session.TraceEventSession.SetFilterDataForEtwSession(String providerGuid, Byte[] data, Boolean V4_5EventSource)
at Microsoft.Diagnostics.Tracing.Session.TraceEventSession.EnableProvider(Guid providerGuid, TraceEventLevel providerLevel, UInt64 matchAnyKeywords, TraceEventProviderOptions options)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.Utility.TraceEventUtil.EnableProvider(TraceEventSession session, Guid providerId, EventLevel level, EventKeywords matchAnyKeyword, IEnumerable
1 arguments, IEnumerable
1 processNamesToFilter, Boolean sendManifest)at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventServiceWorker.Initialize()
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventService.<>c__DisplayClass6.<AddWorkers>b__2()
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventService.HandleException(String callerName, Action body)
Opcode : Info
Task : 64731
Version : 0
Payload : [faultedElement : RollingFlatFileSink] [message : System.UnauthorizedAccessException: Access to the registry key 'HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Winevt\Publishers{659518be-d338-564b-2759-c63c10ef82e2}' is denied.
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.CreateSubKeyInternal(String subkey, RegistryKeyPermissionCheck permissionCheck, Object registrySecurityObj, RegistryOptions registryOptions)
at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck)
at Microsoft.Win32.Registry.SetValue(String keyName, String valueName, Object value, RegistryValueKind valueKind)
at Microsoft.Diagnostics.Tracing.Session.TraceEventSession.SetFilterDataForEtwSession(String providerGuid, Byte[] data, Boolean V4_5EventSource)
at Microsoft.Diagnostics.Tracing.Session.TraceEventSession.EnableProvider(Guid providerGuid, TraceEventLevel providerLevel, UInt64 matchAnyKeywords, TraceEventProviderOptions options)
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.Utility.TraceEventUtil.EnableProvider(TraceEventSession session, Guid providerId, EventLevel level, EventKeywords matchAnyKeyword, IEnumerable
1 arguments, IEnumerable
1 processNamesToFilter, Boolean sendManifest)at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventServiceWorker.Initialize()
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventService.<>c__DisplayClass6.<AddWorkers>b__2()
at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Etw.TraceEventService.HandleException(String callerName, Action body)]
EventName : TraceEventServiceConfigurationFaultInfo
Timestamp : 2015-02-03T16:54:05.9923297Z
ProcessId : 5960
ThreadId : 5528
↧
New Post: Semantic Logging - RollingFlatFileSink - Real-Time Logging
One more update from today:
I'm able to make this work on my home computer with Windows 8.1. However, I'm not able to make this work on a work laptop (Windows 7) or a work server (Windows Server 2012). I wonder if the work machines are locked down in some way that's preventing this from happening.
I'm able to make this work on my home computer with Windows 8.1. However, I'm not able to make this work on a work laptop (Windows 7) or a work server (Windows Server 2012). I wonder if the work machines are locked down in some way that's preventing this from happening.
↧
↧
New Post: Semantic Logging - RollingFlatFileSink - Real-Time Logging
Sounds like permissions. See: Installing and running the Out-of-Process Windows Service/Console Host and https://msdn.microsoft.com/en-us/library/dn775006.aspx for instructions on setting registry key permissions or adding the SLAB OOP Service User to the Performance* group.
↧
New Post: How to support MSE4 and MSE5 in the same project
Hi All ,
Can we use MSE4 and MSE5 in mixed mode in the same project.
MSE(Microsoft Enterprise Library)
In our project we are currently using MSE4 and would like to upgrade to MSE5.
Our project contains interfaces that use ref and out keywords.
But MSE5 does not support ref and key words.
But our requirement is we need to support leacy /old clients that use MSE4 and interfaces that use ref and out keyword.
Is it possible to support multiple interfaces so that we can use MSE4 and MSE5.
Please let me know your ideas / suggestions on that.
Thanks,
Sudhakar
Can we use MSE4 and MSE5 in mixed mode in the same project.
MSE(Microsoft Enterprise Library)
In our project we are currently using MSE4 and would like to upgrade to MSE5.
Our project contains interfaces that use ref and out keywords.
But MSE5 does not support ref and key words.
But our requirement is we need to support leacy /old clients that use MSE4 and interfaces that use ref and out keyword.
Is it possible to support multiple interfaces so that we can use MSE4 and MSE5.
Please let me know your ideas / suggestions on that.
Thanks,
Sudhakar
↧
New Post: Issue with ref keyword in EntLib 5.0
Is this solution ( type.GetElementType()... ) fixed in MSE 6.0? Or, do we still need to modify the library code again and do the same as it is for MSE 5.0?
Inother words, does MSE 6.0 has intelligence to identify 'ref' parameter?
Please help me.
Thanks in advance for your help.
Regards,
Pradeep Daram
Inother words, does MSE 6.0 has intelligence to identify 'ref' parameter?
Please help me.
Thanks in advance for your help.
Regards,
Pradeep Daram
↧
New Post: Issue with ref keyword in EntLib 5.0
Let me check
Sent from my iPhone
Sent from my iPhone
↧
↧
New Post: Multiple EventSource to same rolling file listener
Was wondering if there's anyway to write multiple EventSource classes to the same rolling file listener. Calling EnableEvents multiple times would result in exception.
Thanks.
Thanks.
↧
New Post: Semantic Logging - RollingFlatFileSink - Real-Time Logging
We ended up getting it working. A bit ashamed to say it may have been an oversight on our part. It seems we were looking at the file size in explorer and not seeing any changes so we assumed it was not being written. Apparently it was but we can't be sure if it was always working or if it started working after some additional changes.
We did notice this after we ran through and set permissions in the registry for the account running the OOP service. So that may have still been related as we no longer saw the errors and warnings in event viewer after doing so. Thanks for your help randylevy.
We did notice this after we ran through and set permissions in the registry for the account running the OOP service. So that may have still been related as we no longer saw the errors and warnings in event viewer after doing so. Thanks for your help randylevy.
↧
New Post: Exception Handling Standards -The exception Exception should never been thrown. Always Subclass Exception and throw the subclassed Classes.
Hi,
In the current project my exception handling implementation is as follows :
Exception Handling Layer wise :
DL layer :
catch (Exception ex)
catch (Exception ex)
catch (Exception ex)
The exception Exception should never been thrown. Always Subclass Exception and throw the subclassed Classes.
I need suggestions on how to implement the same according to standards.
In the current project my exception handling implementation is as follows :
Exception Handling Layer wise :
DL layer :
catch (Exception ex)
{
bool rethrow = ExceptionPolicy.HandleException(ex, "Ui Policy");
if (rethrow)
{
throw;
}
}
BL Layer catch (Exception ex)
{
bool rethrow = ExceptionPolicy.HandleException(ex, "Ui Policy");
if (rethrow)
{
throw;
}
}
UI Layercatch (Exception ex)
{
bool rethrow = ExceptionPolicy.HandleException(ex, "Ui Policy");
if (rethrow)
{
Response.Redirect("ErrorPage.aspx", false);
}
}
We have a tool to check the standards. And tool output is as follows :The exception Exception should never been thrown. Always Subclass Exception and throw the subclassed Classes.
I need suggestions on how to implement the same according to standards.
↧
New Post: Multiple EventSource to same rolling file listener
Nevermind. it does support calling EnableEvents multiple times.
↧
↧
New Post: Semantic Logging setup through config file
I was looking forward to switching to the semantic logging block because I was hoping for better performance due to the use of ETW, but without being able to make logging configuration changes via an XML or other config file this is not practical for us. We write software that is deployed to hundreds of clients that are running on different versions of windows OSs and our code is used in web apps and services. With the old MS P&P application block we can simply modify the XML file to increase the level of logging for a specific app at a specific client that we need to troubleshoot.
We can't possibly support the out-of-process version because that entails installing the out-of-process app on tens of thousands of computers with various configurations and we just don't have the time to support getting that working if even just 1% has problems.
It seems we should not use the Semantic Logging block if we need to be able to change logging levels without recompiling. Is that correct?
We can't possibly support the out-of-process version because that entails installing the out-of-process app on tens of thousands of computers with various configurations and we just don't have the time to support getting that working if even just 1% has problems.
It seems we should not use the Semantic Logging block if we need to be able to change logging levels without recompiling. Is that correct?
↧
Created Unassigned: Can we use MSE4 and MSE5 in mixed mode in the same project/SAME CONFIG FILE/application. MSE(Microsoft Enterprise Library) [33843]
Hi All ,
Can we use MSE4 and MSE5 in mixed mode in the same project/SAME CONFIG FILE/application.
MSE(Microsoft Enterprise Library)
In our project we are currently using MSE4 and would like to upgrade to MSE5.
Our project contains interfaces that use ref and out keywords.
But MSE5 does not support ref and key words.
But our requirement is we need to support legacy /old clients that use MSE4 and interfaces that use ref and out keyword.
Is it possible to support multiple interfaces so that we can use MSE4 and MSE5.
__are there any general tips for resolving issues with dependencies ?__
Please let me know your ideas / suggestions on that.
Thanks,
Sudhakar
Can we use MSE4 and MSE5 in mixed mode in the same project/SAME CONFIG FILE/application.
MSE(Microsoft Enterprise Library)
In our project we are currently using MSE4 and would like to upgrade to MSE5.
Our project contains interfaces that use ref and out keywords.
But MSE5 does not support ref and key words.
But our requirement is we need to support legacy /old clients that use MSE4 and interfaces that use ref and out keyword.
Is it possible to support multiple interfaces so that we can use MSE4 and MSE5.
__are there any general tips for resolving issues with dependencies ?__
Please let me know your ideas / suggestions on that.
Thanks,
Sudhakar
↧
New Post: Non reference type error being thrown when before it didnt
I am using Enterprise Library 5.0 and i having trouble with one of the validators.
Here is a property that i have in the following class which represents my Business Entity:
Here is a property that i have in the following class which represents my Business Entity:
[HasSelfValidation]
public class Customer
{
[RequiredValidator]
[IsPositiveIntValidator(MessageTemplate = "Invalid OwnderId.")]
public int? OwnerId {get; set; }
}
The error i am now getting is the following which is different from the one before: Value to validate is null but expected an instance of the non-reference type System.Int32. - Customer.OwnerId
I have a custom validator implementation and usually it calls the DefaultMessageTemplate code: /// <summary>
/// Required validator to ensure value has been specified.
/// </summary>
[ConfigurationElementType(typeof(CustomValidatorData))]
public class RequiredValidator : ValueValidator
{
public override void DoValidate(object objectToValidate, object currentTarget, string key, ValidationResults validationResults)
{
var valid = true;
if (objectToValidate == null)
{
valid = false;
}
else
{
var str = objectToValidate as string;
if (str != null)
{
valid = str.Trim().Length != 0;
}
var dt = objectToValidate as DateTime?;
if (dt != null)
{
valid = dt != DateTime.MinValue;
}
}
if (valid == Negated)
{
LogValidationResult(validationResults, GetMessage(objectToValidate, key), currentTarget, key);
}
}
protected override string DefaultMessageTemplate
{
get
{
return "The {1} must be specified";
}
}
}
Can someone tell me why suddenly i am getting completely different error?↧