Exception Info: System.IO.FileLoadException when running exe on production - c#

I have created one import console application in .net framework 4.5 .
These are the packages that I have used in my application :
<packages>
<package id="CSVReader" version="3.8.1" targetFramework="net40" />
<package id="EnterpriseLibrary.Common" version="6.0.1304.0" targetFramework="net45" />
<package id="EnterpriseLibrary.Data" version="6.0.1304.0" targetFramework="net45" />
<package id="log4net" version="2.0.0" targetFramework="net40" />
<package id="OctoPack" version="2.0.18" targetFramework="net40" />
</packages>
The console application is working absolutely fine on my local system but when I try to deploy it on server and run the exe it is throwing me this error:
Faulting application name: app.exe, version: 1.0.0.0, time stamp: 0x58f0c4a0
Faulting module name: KERNELBASE.dll, version: 6.1.7601.23796, time stamp: 0x59029714
Exception code: 0xe0434352
Fault offset: 0x000000000001a06d
Faulting process id: 0x258
Faulting application start time: 0x01d2df846c72d791
Faulting application path: D:\filePath\app.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Application: app.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileLoadException
at System.ModuleHandle.ResolveType(System.Reflection.RuntimeModule, Int32, IntPtr*, Int32, IntPtr*, Int32, System.Runtime.CompilerServices.ObjectHandleOnStack)
at System.ModuleHandle.ResolveTypeHandleInternal(System.Reflection.RuntimeModule, Int32, System.RuntimeTypeHandle[], System.RuntimeTypeHandle[])
at System.Reflection.RuntimeModule.ResolveType(Int32, System.Type[], System.Type[])
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(System.Reflection.CustomAttributeRecord, System.Reflection.MetadataImport, System.Reflection.Assembly ByRef, System.Reflection.RuntimeModule, System.Reflection.MetadataToken, System.RuntimeType, Boolean, System.Object[], System.Collections.IList, System.RuntimeType ByRef, System.IRuntimeMethodInfo ByRef, Boolean ByRef, Boolean ByRef)
at System.Reflection.CustomAttribute.GetCustomAttributes(System.Reflection.RuntimeModule, Int32, Int32, System.RuntimeType, Boolean, System.Collections.IList, Boolean)
at System.Reflection.CustomAttribute.GetCustomAttributes(System.Reflection.RuntimeAssembly, System.RuntimeType)
at System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, Boolean)
at System.AppDomain.GetTargetFrameworkName()
Does anyone knows what could be the possible reason for this error?
Thanks in advance .

Related

Different versions of ClickOnce application cause crash due to missing original UI.exe file

I´m having a problem with ClickOnce releases:
We need three versions of a program installed via ClickOnce on every machine, each having different settings: Production, Pilot and Test
What we do is use a self programmed release manager that deploys every version in a different network drive location using MSBuild
Installation of every version works out fine, but program crashes when being run.
The ApplicationName is changed while running MSBuild and I have found that the application is still looking for the original UI.exe whilst the name of the Application has changed to e.g. UITest.exe
If I copy the UI.exe to the installation folder and then run UITest.exe the program works as it should.
What am I missing? How can I get rid of the need of the original UI.exe?
Background Infos:
To be able to release three different versions via MSBuild we use an additional ".target" file that is implemented in UI.csproj after the build property groups like this:
<Import Project="CustomBuild.targets" />
The CustomBuild.targets file looks like this:
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishType>none</PublishType>
</PropertyGroup>
<Choose>
<When Condition="'$(PublishType)' == 'production'">
<PropertyGroup>
<PublishUrl>\\netapp1\users\ClickOnce\Production\</PublishUrl>
<InstallUrl>\\netapp1\users\ClickOnce\Production\</InstallUrl>
<PublishDir>\\netapp1\users\ClickOnce\Production\</PublishDir>
<ProductName>UI Production</ProductName>
<AssemblyName>UIProd</AssemblyName> -- AssemblyName is changed here
<UIExchangeSettingsPath>..\_UIExchangeSettings\Prod</UIExchangeSettingsPath>
</PropertyGroup>
</When>
<When Condition=" '$(PublishType)' == 'pilot' ">
<PropertyGroup>
<PublishUrl>\\netapp1\users\ClickOnce\Pilot\</PublishUrl>
<InstallUrl>\\netapp1\users\ClickOnce\Pilot\</InstallUrl>
<PublishDir>\\netapp1\users\ClickOnce\Pilot\</PublishDir>
<ProductName>UI Pilot</ProductName>
<AssemblyName>UIPilot</AssemblyName> -- AssemblyName is changed here
<UIExchangeSettingsPath>..\_UIExchangeSettings\Pilot</UIExchangeSettingsPath>
</PropertyGroup>
</When>
<When Condition=" '$(PublishType)' == 'test' ">
<PropertyGroup>
<PublishUrl>\\netapp1\users\ClickOnce\Test\</PublishUrl>
<InstallUrl>\\netapp1\users\ClickOnce\Test\</InstallUrl>
<PublishDir>\\netapp1\users\ClickOnce\Test\</PublishDir>
<ProductName>UI Test</ProductName>
<AssemblyName>UITest</AssemblyName> -- AssemblyName is changed here
<UIExchangeSettingsPath>..\_UIExchangeSettings\Test</UIExchangeSettingsPath>
</PropertyGroup>
</When>
</Choose>
</Project>
Then the MSBuild Process is called within a batch file like this:
#echo off
set branch=%1
set publishtype=%2
echo Rebuilding UI project and publishing as new %publishtype% version...
>output.txt (
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin\MSBuild.EXE" "C:\Projects\%branch%\UI" /p:SolutionDir="C:\Projects\%branch%\\" /p:PlatformTarget=x86 /p:Configuration=Release /p:PublishType=%publishtype% /t:rebuild /t:publish
)
When running the installed programs they crash and show the following exceptions in the windows event log:
Log Name: Application
Source: .NET Runtime
Date: 11.11.2020 10:02:58
Event ID: 1026
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: vw8-te-012.***.intranet
Description:
Application: UIProd.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
at System.Reflection.RuntimeAssembly._nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, IntPtr, Boolean, Boolean, Boolean)
at System.Reflection.RuntimeAssembly.nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, IntPtr, Boolean, Boolean, Boolean)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(System.Reflection.AssemblyName, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, IntPtr, Boolean, Boolean, Boolean)
at System.Reflection.Assembly.Load(System.Reflection.AssemblyName)
at System.Windows.Navigation.BaseUriHelper.GetLoadedAssembly(System.String, System.String, System.String)
at MS.Internal.AppModel.ResourceContainer.GetResourceManagerWrapper(System.Uri, System.String ByRef, Boolean ByRef)
at MS.Internal.AppModel.ResourceContainer.GetPartCore(System.Uri)
at System.IO.Packaging.Package.GetPartHelper(System.Uri)
at System.IO.Packaging.Package.GetPart(System.Uri)
at System.IO.Packaging.PackWebResponse+CachedResponse.GetResponseStream()
at System.IO.Packaging.PackWebResponse.GetResponseStream()
at System.IO.Packaging.PackWebResponse.get_ContentType()
at MS.Internal.WpfWebRequestHelper.GetContentType(System.Net.WebResponse)
at MS.Internal.WpfWebRequestHelper.GetResponseStream(System.Net.WebRequest, MS.Internal.ContentType ByRef)
at System.Windows.ResourceDictionary.set_Source(System.Uri)
at System.Windows.Baml2006.WpfSharedBamlSchemaContext+<>c.<Create_BamlProperty_ResourceDictionary_Source>b__342_0(System.Object, System.Object)
at System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(System.Object, System.Object)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(System.Xaml.XamlMember, System.Object, System.Object)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(System.Object, System.Xaml.XamlMember, System.Object)
Exception Info: System.Windows.Markup.XamlParseException
at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri)
at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean)
at System.Windows.Application.LoadComponent(System.Object, System.Uri)
at UI.App.InitializeComponent()
at UI.App.Main()
and
Log Name: Application
Source: Application Error
Date: 11.11.2020 10:02:58
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: vw8-te-012.***.intranet
Description:
Faulting application name: UIProd.exe, version: 1.0.0.0, time stamp: 0x5faba858
Faulting module name: KERNELBASE.dll, version: 6.3.9600.17031, time stamp: 0x53088860
Exception code: 0xe0434352
Fault offset: 0x00014dbd
Faulting process ID: 0x3594
Faulting application start time: 0x01d6b80972f79f7d
Faulting application path: C:\Users\***\AppData\Local\Apps\2.0\XNQORKVG.2DT\5A4N7BAY.11G\uipr..tion_e9badd1d426758be_0001.0001_0a1650216431b128\UIProd.exe
Faulting module path: C:\Windows\SYSTEM32\KERNELBASE.dll
Report ID: b1090c1f-23fc-11eb-82ef-0050568fb707
Faulting package full name:
Faulting package-relative application ID:
Turns out it was a reference to a resource dictionary in App.xaml causing the problem.
Wrong implementation:
<ResourceDictionary Source="pack://application:,,,/UI;component/Resources/PlcBuildResources.xaml" />
Corrected implementation:
<ResourceDictionary Source="../Resources/PlcBuildResources.xaml"/>
Lesson learned: Be careful when referencing resource dictionaries or other files using the assembly name in the reference. If the assembly name is changed when building via MSBuild as in my case, the referenced file will not be found and cause the application to crash.

The process was terminated due to an unhandled exception - WCF service

So I have a WCF service that i created that gets messages from customer and parses them to desired output and sends them to other customer via TCP/HTTP/FTP etc.
This windows service has long running threads for each customer created using TPL's.
So for logging I have used NLOG, log to file and event viewer with below configurations
<target xsi:type="File" name="flatfile" layout="${longdate} ${uppercase:${level}} ${message} ${exception:format=tostring,StackTrace}"
archiveAboveSize="2000000" archiveFileName="${basedir}/logs/archive/${shortdate}-{#####}.engine.log" archiveNumbering="Sequence" archiveEvery="None"
maxArchiveFiles="100" fileName="${basedir}/logs/engine.current.log" keepFileOpen="true" concurrentWrites="true" />
<target xsi:type="EventLog" name="eventlog" layout="${longdate} ${uppercase:${level}} ${message} ${exception:format=tostring} ${StackTrace}" log="Application" source="Nuance Interface Engine Service" eventId="${event-properties:EventID}" />
Even when I added concurrentWrites="true", when I start WCF service after 20+ hours of time passes I got below error in event viewer
Application: MyWcfService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.OutOfMemoryException
at System.Text.StringBuilder..ctor(System.String, Int32, Int32, Int32)
at NLog.Layouts.SimpleLayout.GetFormattedMessage(NLog.LogEventInfo)
at NLog.Targets.FileTarget.GetFormattedMessage(NLog.LogEventInfo)
at NLog.Targets.FileTarget.GetBytesToWrite(NLog.LogEventInfo)
at NLog.Targets.FileTarget.Write(NLog.Common.AsyncLogEventInfo[])
at NLog.Targets.Target.WriteAsyncLogEvents(NLog.Common.AsyncLogEventInfo[])
at NLog.Targets.Wrappers.AsyncTargetWrapper.ProcessPendingEvents(System.Object)
at System.Threading.TimerQueueTimer.CallCallbackInContext(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.TimerQueueTimer.CallCallback()
at System.Threading.TimerQueueTimer.Fire()
at System.Threading.TimerQueue.FireQueuedTimerCompletion(System.Object)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Could you please someone guide me on where this issue is occuring, I thought multiple threads are accessing this log file hence I added concurrentWrites="true" attribute to nlog's file target.
after 1 second passes to above error, I see one more error in my event viewer.
Faulting application name: Hl7ic.Engine.View.exe, version: 18.0.1.160, time stamp: 0x5af5cd1f
Faulting module name: KERNELBASE.dll, version: 6.3.9600.18938, time stamp: 0x5a7dd8a7
Exception code: 0xe0434352
Fault offset: 0x00015ef8
Faulting process id: 0x1074
Faulting application start time: 0x01d3ea7338d9851c
Faulting application path: C:\Program Files (x86)\MyServices\MyWcfService.exe
Faulting module path: C:\windows\SYSTEM32\KERNELBASE.dll
Report Id: 59b36929-5688-11e8-80ca-005056a80aaa
Faulting package full name:
Faulting package-relative application ID:
OutOfMemoryException means that there is not enough memory on the machine. Maybe it has been used up by another application. Maybe it has been used up by your application. Maybe your 32 bit application have used up its memory address space of 2 Gigabyte.
To diagnose this error, then use Process Explorer to capture a Fulldump of the application that uses too much memory. Then try using Visual Studio or WinDbg to investigate the memory dumpfile.
To remove NLog from the radar, then you can upgrade to NLog 4.4.6 (or newer). It will reduce memory allocations with 70 pct. from older versions (When using FileTarget)
If running NLog 4.4.6 (or newer) then you can optimize NLog even further by not using <targets async="true"> but instead use this default-wrapper:
<targets>
<default-wrapper xsi:type="AsyncWrapper" timeToSleepBetweenBatches="0" />
<target .... />
<target .... />
</targets>
See also https://github.com/NLog/NLog/wiki/Performance

EXE file of a console application doing nothing and abort when pressing any key

I've written a console application that ran and update some records in Dynamics CRM. It worked fine when run it through bin\Release folder. But it abort if I copy the files from release folder and paste on some other some others computer.
Is there anybody who can let me know how can I resolve the problem??
Here is what I've in event viewr:
Log Name: Application
Source: Application Error
Date: 11/3/2015 2:13:01 AM
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: ****.****.****.****
Description:
Faulting application name: updateAudits.exe, version: 1.0.0.0, time stamp: 0x563884c0
Faulting module name: KERNELBASE.dll, version: 6.1.7601.18933, time stamp: 0x55a6a16f
Exception code: 0xe0434352
Fault offset: 0x000000000000b3dd
Faulting process id: 0x16d8
Faulting application start time: 0x01d1162032fc311e
Faulting application path: C:\Users\*****\Desktop\updateAudits\Release\Release\updateAudits.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: 7625d31e-8213-11e5-b719-005056b016ab
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Level>2</Level>
<Task>100</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2015-11-03T10:13:01.000000000Z" />
<EventRecordID>14183</EventRecordID>
<Channel>Application</Channel>
<Computer>***.***.***.***</Computer>
<Security />
</System>
<EventData>
<Data>updateAudits.exe</Data>
<Data>1.0.0.0</Data>
<Data>563884c0</Data>
<Data>KERNELBASE.dll</Data>
<Data>6.1.7601.18933</Data>
<Data>55a6a16f</Data>
<Data>e0434352</Data>
<Data>000000000000b3dd</Data>
<Data>16d8</Data>
<Data>01d1162032fc311e</Data>
<Data>C:\Users\SIS!SVC-Dynamics\Desktop\updateAudits\Release\Release\updateAudits.exe</Data>
<Data>C:\Windows\system32\KERNELBASE.dll</Data>
<Data>7625d31e-8213-11e5-b719-005056b016ab</Data>
</EventData>
</Event>
Please check the eventlog(Application) in the copied system which will probably enlight on the assembly which was missing.

The program '[13476] MyApp.vshost.exe' has exited with code -1 (0xffffffff)

I have a project with Output Type of Console Application that sometimes fails to start up when I debug. When this happens, may app starts to run and write to the vshost.exe console that is hosting the process being debugged. Then all of a sudden I will see a message in the Output window that says something like "The program '[13476] MyApp.vshost.exe' has exited with code -1 (0xffffffff)."
It doesn't happen every time, but when it does the Console Window my app started up in freezes on the screen and the debugger seems to halt. However, the vshost.exe process does not actually stop (I can see it in Task Manager with the same Process ID as the error message). It is as if Visual Studio thinks the process has exited, but it really has not. When I stop the debugger, the console window remains frozen on the screen as well. The only way to get the debugger to work again is to shutdown and restart VS.
This also happens if I have the Visual Studio hosting process turned off. The application only has one exit point in the Main method and when this happens a breakpoint on that line of code is not hit.
I cannot figure out how to get any more detail about why this is happening to troubleshoot further. I have put code in the AppDomain.CurrentDomain.UnhandledExcpetion handler as well as the Application.ApplicationExit handler, but they are not being hit when this problem occurs. I also don't see anything in the Windows event log, etc.
Output Window sample
...
'MyApp.vshost.exe' (CLR v4.0.30319: MyApp.vshost.exe): Loaded
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll'.
Cannot find or open the PDB file.
'MyApp.vshost.exe' (CLR v4.0.30319: MyApp.vshost.exe): Loaded
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll'.
Cannot find or open the PDB file.
'MyApp.vshost.exe' (CLR v4.0.30319: MyApp.vshost.exe): Loaded
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.Diagnostics.ServiceModelSink\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Diagnostics.ServiceModelSink.dll'.
Cannot find or open the PDB file.
'MyApp.vshost.exe' (CLR v4.0.30319: MyApp.vshost.exe): Loaded
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll'.
Skipped loading symbols. Module is optimized and the debugger option
'Just My Code' is enabled.
The thread 0xf18 has exited with code 259 (0x103).
The thread 0x2928 has exited with code 259 (0x103).
The thread 0x3654 has exited with code 259 (0x103).
The program '[13476] MyApp.vshost.exe' has exited with code -1
(0xffffffff).
I found the events below in the event log. However, it was in a weird spot I’ve never looked before Event Viewer -> Custom Views -> Administrative Events. This lead me to the MS KB http://support.microsoft.com/kb/2773443.
The MyApp project is targeting .NET 4.0 and I recently have installed Visual Studio 2013 on my laptop (.NET 4.5), which is around the time the issue started to occur. So I assume this is my issue.
What I don’t understand is why this exception wasn’t raising the AppDomain.UnhandledExcpetion event in my MyApp project and instead was silently terminating the process. The WCF service that was causing this issue was being started from a new thread that was being kicked off, but I think exceptions in this thread should still raise the AppDomain.UnhandledExcpetion event. I verified the UndhandledException handler is working in my application.
To resolve this, I have moved the startup of this service to its own project that targets .NET 3.5 and x86. This more mimics how we run the application in production anyway so it works for me. There is a patch and various work arounds in the Microsoft KB as well.
I hope this helps someone, I was beating my head against the wall trying to figure out how to even get the exception that was causing my issue.
Log Name: Application
Source: .NET Runtime
Date: 1/21/2014 9:09:23 AM
Event ID: 1026
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: DUDELT
Description:
Application: MyApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ServiceModel.AddressAlreadyInUseException
Stack:
at System.ServiceModel.Channels.TransportManager.Open(System.ServiceModel.Channels.TransportChannelListener)
at System.ServiceModel.Channels.TransportManagerContainer.Open(System.ServiceModel.Channels.SelectTransportManagersCallback)
at System.ServiceModel.Channels.TransportChannelListener.OnOpen(System.TimeSpan)
at System.ServiceModel.Channels.ConnectionOrientedTransportChannelListener.OnOpen(System.TimeSpan)
at System.ServiceModel.Channels.TcpChannelListener`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnOpen(System.TimeSpan)
at System.ServiceModel.Channels.CommunicationObject.Open(System.TimeSpan)
at System.ServiceModel.Channels.ReliableChannelListenerBase`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnOpen(System.TimeSpan)
at System.ServiceModel.Channels.CommunicationObject.Open(System.TimeSpan)
at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(System.TimeSpan)
at System.ServiceModel.Channels.CommunicationObject.Open(System.TimeSpan)
at System.ServiceModel.ServiceHostBase.OnOpen(System.TimeSpan)
at System.ServiceModel.Channels.CommunicationObject.Open(System.TimeSpan)
at System.ServiceModel.Channels.CommunicationObject.Open()
at MyApp32.MyApp32.Main()
at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name=".NET Runtime" />
<EventID Qualifiers="0">1026</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2014-01-21T14:09:23.000000000Z" />
<EventRecordID>287767</EventRecordID>
<Channel>Application</Channel>
<Computer>DUDELT</Computer>
<Security />
</System>
<EventData>
<Data>Application: MyApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ServiceModel.AddressAlreadyInUseException
Stack:
at System.ServiceModel.Channels.TransportManager.Open(System.ServiceModel.Channels.TransportChannelListener)
at System.ServiceModel.Channels.TransportManagerContainer.Open(System.ServiceModel.Channels.SelectTransportManagersCallback)
at System.ServiceModel.Channels.TransportChannelListener.OnOpen(System.TimeSpan)
at System.ServiceModel.Channels.ConnectionOrientedTransportChannelListener.OnOpen(System.TimeSpan)
at System.ServiceModel.Channels.TcpChannelListener`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnOpen(System.TimeSpan)
at System.ServiceModel.Channels.CommunicationObject.Open(System.TimeSpan)
at System.ServiceModel.Channels.ReliableChannelListenerBase`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnOpen(System.TimeSpan)
at System.ServiceModel.Channels.CommunicationObject.Open(System.TimeSpan)
at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(System.TimeSpan)
at System.ServiceModel.Channels.CommunicationObject.Open(System.TimeSpan)
at System.ServiceModel.ServiceHostBase.OnOpen(System.TimeSpan)
at System.ServiceModel.Channels.CommunicationObject.Open(System.TimeSpan)
at System.ServiceModel.Channels.CommunicationObject.Open()
at MyApp32. MyApp 32.Main()
at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
</Data>
</EventData>
</Event>
Log Name: Application
Source: Application Error
Date: 1/21/2014 9:09:23 AM
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: DUDELT
Description:
Faulting application name: MyApp.exe, version: 0.0.0.0, time stamp: 0x52dd9b89
Faulting module name: KERNELBASE.dll, version: 6.1.7601.18229, time stamp: 0x51fb1116
Exception code: 0xe0434352
Fault offset: 0x0000c41f
Faulting process id: 0x3ac0
Faulting application start time: 0x01cf16b23d49d636
Faulting application path: C:\MyApp\MyApp\bin\Debug\MyApp.exe
Faulting module path: C:\Windows\syswow64\KERNELBASE.dll
Report Id: a0b3e605-82a5-11e3-ab71-0021cc6f2033
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Level>2</Level>
<Task>100</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2014-01-21T14:09:23.000000000Z" />
<EventRecordID>287768</EventRecordID>
<Channel>Application</Channel>
<Computer>DUDELT</Computer>
<Security />
</System>
<EventData>
<Data>MyApp.exe</Data>
<Data>0.0.0.0</Data>
<Data>52dd9b89</Data>
<Data>KERNELBASE.dll</Data>
<Data>6.1.7601.18229</Data>
<Data>51fb1116</Data>
<Data>e0434352</Data>
<Data>0000c41f</Data>
<Data>3ac0</Data>
<Data>01cf16b23d49d636</Data>
<Data>C:\code\MyApp\MyApp\bin\Debug\MyApp.exe</Data>
<Data>C:\Windows\syswow64\KERNELBASE.dll</Data>
<Data>a0b3e605-82a5-11e3-ab71-0021cc6f2033</Data>
</EventData>
</Event>
I hit the same issue, and it looks a .net undocumented issue. But you can mitigate it as follow:
find the portion of code that fail, and follow the class that you try to read.
add a default constructor for that class. The serialization in some case needs a default constructor to create the objects, and this is the actual issue.
Hope this works for future generations who will search for this error! :)
D

App exe crashing at startup. Faulting module path c:\windows\syswow64\kernalbase.dll

Whenever I try to launch my app on a machine that isnt mine it crashes at start up. I am at a loss and have done a ton of searching with no resolution. There is no real error I just get the standard windows 7 not responding. All machines are win7Pro 64 with .net4. I am seeing the event viewer logs below.
Event id 1000:
Faulting application name: MarketingRequests.exe, version: 1.0.0.0, time stamp: 0x5033e787
Faulting module name: KERNELBASE.dll, version: 6.1.7601.17651, time stamp: 0x4a5bdbdf
Exception code: 0xe0434352
Fault offset: 0x0000b9bc
Faulting process id: 0x1ecc
Faulting application start time: 0x01cd7fe56831cfd9
Faulting application path: C\Intranet\MarketingRequests.exe
Faulting module path: C:\Windows\syswow64\KERNELBASE.dll
Report Id: a78399b1-ebd8-11e1-9474-f04da20e6eaf
I am also seeing event ID 1026, .net runtime:
Log Name: Application
Source: .NET Runtime
Date: 8/21/2012 9:08:53 PM
Event ID: 1026
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: CORRIE-Z.msing.local
Description:
Application: ExpenseReport.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
Stack:
at System.Data.Linq.SqlClient.SqlProvider.Execute(System.Linq.Expressions.Expression, QueryInfo, System.Data.Linq.SqlClient.IObjectReaderFactory, System.Object[], System.Object[], System.Data.Linq.SqlClient.ICompiledSubQuery[], System.Object)
at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(System.Linq.Expressions.Expression, QueryInfo[], System.Data.Linq.SqlClient.IObjectReaderFactory, System.Object[], System.Data.Linq.SqlClient.ICompiledSubQuery[])
at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(System.Linq.Expressions.Expression)
at System.Data.Linq.DataQuery1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].System.Linq.IQueryProvider.Execute[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Linq.Expressions.Expression)
at System.Linq.Queryable.First[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Linq.IQueryable1)
at ExpenseReport.frmMain.refreshEmpInfo()
at ExpenseReport.frmMain..ctor()
at ExpenseReport.Program.Main()
Event Xml:
1026
2
0
0x80000000000000
26474
Application
CORRIE-Z.msing.local
Application: ExpenseReport.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
Stack:
at System.Data.Linq.SqlClient.SqlProvider.Execute(System.Linq.Expressions.Expression, QueryInfo, System.Data.Linq.SqlClient.IObjectReaderFactory, System.Object[], System.Object[], System.Data.Linq.SqlClient.ICompiledSubQuery[], System.Object)
at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(System.Linq.Expressions.Expression, QueryInfo[], System.Data.Linq.SqlClient.IObjectReaderFactory, System.Object[], System.Data.Linq.SqlClient.ICompiledSubQuery[])
at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(System.Linq.Expressions.Expression)
at System.Data.Linq.DataQuery1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].System.Linq.IQueryProvider.Execute[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Linq.Expressions.Expression)
at System.Linq.Queryable.First[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Linq.IQueryable1<System.__Canon>)
at ExpenseReport.frmMain.refreshEmpInfo()
at ExpenseReport.frmMain..ctor()
at ExpenseReport.Program.Main()
It looks like frmMain.refreshEmpInfo contains a LINQ query that retrieves a record from the database, and the LINQ query calls First() to get the first record. Is it possible that no records are being returned, which would cause First() to throw an InvalidOperationException?
(It might be helpful if you posted the code in frmMain.refreshEmpInfo. You might also want to wrap that code in a try...catch block and display the exception details in a message box.)

Categories