Enterprise Semantic Logging OOP Exception - c#

I'm trying to use Out-Process Logging using Semantic Logging Application Block. I have downloaded and installed out of process service from here, changed the event source name to point to my source name. But on running the service I get following error:
Message : A fault was detected while processing the configuration for the element 'svcRuntime'. Message: System.Runtime.InteropServices.COMException (0x800705AA): Insufficient system resources exist to
complete the requested service. (Exception from HRESULT: 0x800705AA)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.Diagnostics.Tracing.Session.TraceEventSession.InsureStarted(EVENT_TRACE_PROPERTIES* properties)
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, IEnume
rable`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 : svcRuntime] [message : System.Runtime.InteropServices.COMException (0x800705AA): Insufficient system resources exist to complete the requested service. (Exception from HRESU
LT: 0x800705AA)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.Diagnostics.Tracing.Session.TraceEventSession.InsureStarted(EVENT_TRACE_PROPERTIES* properties)
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, IEnume
rable`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-28T10:31:09.3220291Z
ProcessId : 16524
ThreadId : 16984
The In-Process listener works fine. Is there anything else I need to do configure?

In my case it was related to the amount of flat file sinks that I have configured in the SemanticLogging-svc.xml.
It seems once I go past 36 file sinks this error appears.

Related

Visual studio Windows Form designer error: "Construction of frame content failed."

After I added a UserControl to my Form it suddenly started to produce this error:
Error HRESULT E_FAIL has been returned from a call to a COM component
So I googled around and found out it is somehow related to cache. So I deleted suo file from my solution. And now it produces this error:
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
I googled that too and found out I should read the contents of the ActivityLog.xml which can be found in %appdata%\Microsoft\VisualStudio. It starts with this message:
Construction of frame content failed.
I couldn't find any solution any further.
here is the complete error from that log:
Construction of frame content failed. Frame identifier:
ST:0:0:{31fc2115-5126-4a87-b2f7-77eaab65048b} Frame caption: Exception
details: System.ArgumentNullException: Parameter name: protocolHandler
at
Microsoft.XamlDiagnostics.UI.LivePropertyExplorer.Model.PropertyExplorerModel..ctor(IProtocolHandler
protocolHandler, IActiveElementTracker tracker, ITelemetryLogger
telemetryLogger) at
Microsoft.XamlDiagnostics.Model.XamlDiagnosticsTool.GetPropertyExplorerModel(IServiceProvider
serviceProvider) at
Microsoft.XamlDiagnostics.Model.XamlDiagnosticsTool.CreatePropertyExplorer(IServiceProvider
serviceProvider, ResourceDictionary themeDictionary, UIElement
searchContentControl) at
Microsoft.VisualStudio.ClientDiagnostics.XamlDiagnostics.PropertyExplorerToolWindow.GetContent()
at
Microsoft.VisualStudio.ClientDiagnostics.XamlDiagnostics.XamlDiagnosticsToolWindowBase.ShowContent()
at
Microsoft.VisualStudio.ClientDiagnostics.XamlDiagnostics.XamlDiagnosticsToolWindowBase.Initialize()
at
Microsoft.VisualStudio.Shell.WindowPane.InternalSetSite(IServiceProvider
p) at
Microsoft.VisualStudio.Shell.WindowPane.Microsoft.VisualStudio.Shell.Interop.IVsWindowPane.SetSite(IServiceProvider
psp) at
Microsoft.VisualStudio.Shell.WindowPane.Microsoft.VisualStudio.Shell.Interop.IVsUIElementPane.SetUIElementSite(IServiceProvider
p) at
Microsoft.VisualStudio.Platform.WindowManagement.UIElementDocumentObject.SetSite(DocumentObjectSite
site) at
Microsoft.VisualStudio.Platform.WindowManagement.DocumentObjectSite.InitializeDocumentObject(Object
punkView) at
Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.CreateContentPane(FrameMoniker
frameMoniker, Boolean isDocument, String lpstrMkDoc, UInt32
eCreateWindowFlags, Object punkView, Object punkData, IServiceProvider
pServiceProvider, IVsUIHierarchy pUIHierarchy, UInt32 vsid, Guid
rguidCmdUI, ViewGroup parent, IVsWindowFrame& ppWindowFrame) at
Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.CreateContentPane(String
pszName, Int32 fDockViewOn, Int32 fDocument, String lpstrMkDoc, UInt32
eCreateWindowFlags, UInt32 dwToolWinId, Object punkView, Object
punkData, IServiceProvider pServiceProvider, IVsUIHierarchy
pUIHierarchy, UInt32 vsid, Int32& pfDefaultPosition, Guid& rguidCmdUI,
IVsWindowFrame& ppWindowFrame) at
System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32
errorCode, IntPtr errorInfo) at
Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type
toolWindowType, Int32 id, UInt32 flags) at
Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type
toolWindowType, Int32 id, ProvideToolWindowAttribute tool) at
Microsoft.VisualStudio.Shell.Package.FindToolWindow(Type
toolWindowType, Int32 id, Boolean create, ProvideToolWindowAttribute
tool) at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Guid&
toolWindowType, Int32 id) at
Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsToolWindowFactory.CreateToolWindow(Guid&
toolWindowType, UInt32 id) at
Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()
What's going on? What does Construction of frame content failed mean?
Thanks to Caius I managed to find the problem. The designer was unable to render the Form because of an error regarding the UserControl. I looked into the designer.cs file and find a warning saying that there is a conflict between UserControl [version] in [path] and UserControl in [path].
I looked into the references of the project and found a self-reference there! So I removed it and the error went away.
The UserControl and Form were in the same project and while adding the UserControl to the Form I drag-and-dropped the UserControl from the Toolbox onto the Form. So it automatically added a self-reference to my project. I'm not sure why it did that. But removing the reference solved the issue.

Fixing designer problems

After compute restart and open simple desktop project I found error To prevent possible data loss before loading the designer, the following errors must be resolved:
call stack:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.VisualStudio.NativeMethods.ThrowOnFailure(Int32 hr, Int32[] expectedHRFailure)
at Microsoft.VisualStudio.Shell.Design.Serialization.DesignerDocDataService.GetFileDocData(String fileName, FileAccess access, String createTemplate, Boolean addToHostList, Boolean nestedItem)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomProvider.OnParseBegin(TextReader reader)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.Parse(TextReader codeStream)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.MergedCodeDomParser.System.CodeDom.Compiler.ICodeParser.Parse(TextReader stream)
at System.CodeDom.Compiler.CodeDomProvider.Parse(TextReader codeStream)
at Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.CodeDomDocDataAdapter.get_CompileUnit()
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
How to fight with such errors and bring my form designer back?
You must have deleted something and You must delete it from designer. If you had done a delete operation , go to designer page and delete it from here also. Than if do you want add your control again, you can add it after this operation

C# Xamarin android "Central Directory record could not be found"

Following issue occurs when building the project.
Output Window Details
*1>------ Rebuild All started: Project: XYZ.Droid, Configuration: Debug Any CPU ------
1>C:\Users\amila.s\Desktop\XYZ\ABC.Mobile-develop\ABC.Mobile-develop\packages\Xamarin.Build.Download.0.4.7\build\Xamarin.Build.Download.targets(114,3): error : End of Central Directory record could not be found.
1>C:\Users\amila.s\Desktop\XYZ\ABC.Mobile-develop\ABC.Mobile-develop\packages\Xamarin.Build.Download.0.4.7\build\Xamarin.Build.Download.targets(114,3): error : at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
1>C:\Users\amila.s\Desktop\XYZ\ABC.Mobile-develop\ABC.Mobile-develop\packages\Xamarin.Build.Download.0.4.7\build\Xamarin.Build.Download.targets(114,3): error : at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode, Boolean leaveOpen)
1>C:\Users\amila.s\Desktop\XYZ\ABC.Mobile-develop\ABC.Mobile-develop\packages\Xamarin.Build.Download.0.4.7\build\Xamarin.Build.Download.targets(114,3): error : at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding)
1>C:\Users\amila.s\Desktop\XYZ\ABC.Mobile-develop\ABC.Mobile-develop\packages\Xamarin.Build.Download.0.4.7\build\Xamarin.Build.Download.targets(114,3): error : at Xamarin.Build.Download.XamarinBuildAndroidAarRestore.LoadResource(String resourceFullPath, String assemblyName)
1>C:\Users\amila.s\Desktop\XYZ\ABC.Mobile-develop\ABC.Mobile-develop\packages\Xamarin.Build.Download.0.4.7\build\Xamarin.Build.Download.targets(114,3): error : at Xamarin.Build.Download.BaseXamarinBuildResourceRestore.MergeResources(IAssemblyResolver resolver, String originalAsmPath, String mergedAsmPath, String assemblyName, List`1 resourceItems)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========*
Error Window Details
Severity Code Description Project File Line Suppression State
Error End of Central Directory record could not be found. at
System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory() at
System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode
mode, Boolean leaveOpen) at
System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode
mode, Boolean leaveOpen, Encoding entryNameEncoding) at
Xamarin.Build.Download.XamarinBuildAndroidAarRestore.LoadResource(String
resourceFullPath, String assemblyName) at
Xamarin.Build.Download.BaseXamarinBuildResourceRestore.MergeResources(IAssemblyResolver
resolver, String originalAsmPath, String mergedAsmPath, String
assemblyName, List`1 resourceItems) PayByCar.Droid
There are seem to be no much support regarding this issue. It would be highly appreciated if anyone could help on this. Thanks.
Just in case anyone else is getting this issue as well, (And cannot simply do like what a lot of other threads recommend, by changing the version of Xamarin.Build.Download to a previous version):
My solution was to go to C:\Users\(username)\AppData\Local and delete the Xamarin and XamarinBuildDownloadCache, then rebuild my project.
I presume that due to a faulty network connection, one or more files had been corrupted during the initial download process, which made it so that even clearing just about everything (except that directory) would not fix the issue.

Failure in delete performance counter category

I have this simple code:
public void CreateCounters() {
if (PerformanceCounterCategory.Exists(_categoryName)) {
PerformanceCounterCategory.Delete(_categoryName);
}
// create logic…
}
works on my machine.
I run it on my server, get the following stack trace:
System has detected a fatal error. EXITING...
NativeErrorCode: 1010
ErrorCode: -2147467259
Message: The configuration registry key is invalid
TargetSite: Void RegisterFiles(System.String, Boolean)
HelpLink:
Source: System
Stack Trace:
at System.Diagnostics.PerformanceCounterLib.RegisterFiles(String arg0, Boolean unregister)
at System.Diagnostics.PerformanceCounterCategory.Delete(String categoryName)
at myApp.Common.Utils.PerformanceCounters.PerformanceCounters.CreateCounters()
at myApp.Common.Utils.PerformanceCounters.myAppPerformanceCounterReporter.Init()
at myApp.Common.Utils.PerformanceCounters.myAppPerformanceCounterReporter.get_Instance()
at myApp.Program.Main(String[] args)
The category exists on the server, I can see it in perfmon GUI.
ok this is some error in performance counter mechanis, that should be fixed by the following script :
cd %systemroot%\system32
lodctr /R
check out this link : http://geekswithblogs.net/robz/archive/2008/08/10/possible-performance-counter-corruption-or-performance-counters-are-just-disabled.aspx

problem breaking up one SharePoint project into pieces

I'm trying to break my sharepoint project into a few smaller projects.
I could easily move utility files in different project.
However i encountered a problem when i moved custom-fields.
If i move custom-field from ProjectA to ProjectB and set ProjectA to reference ProjectB's DLL, building and deploying work fine. However, when program reference custom-field from SPListItem, it will throw System.ArgumentOutOfRangeException.
e.g.
SPListItem item = splist.GetItemById(id);<br>
CustomFieldValue custom = item["Custom"] // Error occurs here
Also, if i call AddFieldAsXml to define above custom-field, i get same error.
can anyone help me solve this problem?
thank you in advance...
Detail of Error occured in AddFieldAsXml (same error occurs when referencing)
Length cannot be less than zero.
Parameter name: length
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +7494967
System.String.Substring(Int32 startIndex, Int32 length) +11
Microsoft.SharePoint.Publishing.PublishingHttpModule.CreateSPField(String fieldTypeName, SPFieldCollection collection, String fieldName) +80
Microsoft.SharePoint.SPFieldCollection.CreateSPField(Int32 index) +2746
Microsoft.SharePoint.SPFieldCollection.EnsureSPField(Int32 index) +89
Microsoft.SharePoint.SPFieldCollection.get_Item(Int32 iIndex) +113
Microsoft.SharePoint.SPFieldCollection.GetFieldByInternalName(String strName, Boolean bThrowException) +180
Microsoft.SharePoint.SPFieldCollection.GetFieldByInternalName(String strName) +38
Microsoft.SharePoint.SPFieldCollection.AddFieldAsXmlInternal(String schemaXml, Boolean addToDefaultView, SPAddFieldOptions op) +905
Microsoft.SharePoint.SPFieldCollection.AddFieldAsXml(String schemaXml, Boolean addToDefaultView, SPAddFieldOptions op) +45
This error displayed if string.substring(int startIndex, int length)'s length value is minus...
but i don't know why i get this error.
I solved the problem...
I didn't copy the fldtypes_xxxx.xml information.
so when the code try to read some information from the xml, exception is thrown...

Categories