unhandled Exception C# - c#

I have a C# project which is an exe file (console app) and some dlls and one dll ist written in C++. On Winodws 10 it runs fine and on a Win 7 too. But on a Win 7 and Win2008 Server on a Virtual Maschine I get an unhandled exception. In the main function I have already added
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
But unfortunately the exception must be thrown before the main function is called. How can I catch this exception?
I have installed .net 4.6.1 and I compared the installed packages between Win 10 and Win 7 on real PCs with the installed packages on the virutal maschines and I fine no different.
Thats what I can see in the event log:
<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="2020-08-14T10:03:41.000000000Z" />
<EventRecordID>5060</EventRecordID>
<Channel>Application</Channel>
<Computer>PC-dummy</Computer>
<Security />
</System>
<EventData>
<Data>MyApp.exe</Data>
<Data>1.6.1.1</Data>
<Data>5f365f53</Data>
<Data>KERNELBASE.dll</Data>
<Data>6.1.7601.24511</Data>
<Data>5d3fa9ff</Data>
<Data>e0434352</Data>
<Data>000000000000b87d</Data>
<Data>658</Data>
<Data>01d67222300b6618</Data>
<Data>D:\MyProject\MyApp.exe</Data>
<Data>C:\Windows\system32\KERNELBASE.dll</Data>
<Data>6dbcb3b9-de15-11ea-b17f-000c29a2a32b</Data>
</EventData>
</Event>
and
<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="2020-08-14T10:03:41.000000000Z" />
<EventRecordID>5059</EventRecordID>
<Channel>Application</Channel>
<Computer>PC-dummy</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.IO.FileNotFoundException at MyConsole.Program.Main(System.String[])</Data>
</EventData>
</Event>

Related

Read event error logs for specific application

Hi i'm trying to make a c# console application that will monitor copychimp.exe if it sets an error on event logs on current date
Here's what i have try
static void Main(string[] args)
{
string eventlofName = "Application";
EventLog logs = new EventLog();
logs.Log = eventlofName;
foreach(EventLogEntry log in logs.Entries){
Console.WriteLine("{0}\n" + log.Message);
}
}
this is my step and don't know whats next.
I have no control on Copychimp.exe.
Here's the error on event logs i want to capture
- <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="2019-10-18T05:26:38.001427000Z" />
<EventRecordID>17564</EventRecordID>
<Channel>Application</Channel>
<Computer>PHCAB01DT0160.NWS.NEXPERIA.COM</Computer>
<Security />
</System>
- <EventData>
<Data>Application: CopyChimpServer.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.IndexOutOfRangeException at CopyChimpServer.Program.Main(System.String[])</Data>
</EventData>
</Event>
Out put if copychimp.exe has an error on event logs in event viewer check if it is equals to date now it should print "An error Occured an CopyChimp.exe "
the reason for this app is to monitor if copychimp.exe has crashed in order to re run it, it is running on server so there should be a other app that will monitor copychimp
Hope you understand what i mean
Sorry for my bad english

VS 2015 Crash on Windows 10 Anniversary Update

Recently I updated my Windows 10 with the Anniversary update. Since then Visual Studio crashes like crazy and some of the programs are not working.
Here are the crash errors:
- <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="2016-08-18T18:16:39.081375400Z" />
<EventRecordID>2999</EventRecordID>
<Channel>Application</Channel>
<Computer>PC</Computer>
<Security />
</System>
- <EventData>
<Data>Application: devenv.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.TypeLoadException at
Microsoft.VisualStudio.VIL.DebuggerHost.VirtualAppDomain.get_DebuggerTypeUniverse() at
Microsoft.VisualStudio.VIL.DebuggerHost.GlobalContext.Dispose(Boolean) at
Microsoft.VisualStudio.VIL.VisualStudioHost.VSGlobalContext.Dispose(Boolean) at
Microsoft.VisualStudio.VIL.VisualStudioHost.Interpreter.Destroy() at
VSDebugEngine.ClrInspector.VilHelper.Dispose() at
VSDebugEngine.ClrInspector.VilHelper.OnClose() at
Microsoft.VisualStudio.Debugger.DkmDataItem.InvokeOnClose(XapiComponentInfo*, Microsoft.VisualStudio.Debugger.DkmDataItem) at
Microsoft.VisualStudio.Debugger.DkmDataContainer.OnCloseNativeObject(XapiComponentInfo**) at
Microsoft.VisualStudio.Debugger.DkmDataContainer.Callback_OnCloseNativeObject(IntPtr, XapiComponentInfo**)</Data>
</EventData>
</Event>
And
- <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="2016-08-18T18:16:39.250653400Z" />
<EventRecordID>3000</EventRecordID>
<Channel>Application</Channel>
<Computer>PC</Computer>
<Security />
</System>
- <EventData>
<Data>devenv.exe</Data>
<Data>14.0.25420.1</Data>
<Data>57685d85</Data>
<Data>KERNELBASE.dll</Data>
<Data>10.0.14393.0</Data>
<Data>57898e34</Data>
<Data>e0434352</Data>
<Data>000d96c2</Data>
<Data>1e38</Data>
<Data>01d1f97c98f42dde</Data>
<Data>C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe</Data>
<Data>C:\WINDOWS\System32\KERNELBASE.dll</Data>
<Data>f9cb238c-e79f-46c2-bd5e-1ddcaa9fb9c7</Data>
<Data />
<Data />
</EventData>
- <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="2016-08-18T19:10:34.635049600Z" />
<EventRecordID>3122</EventRecordID>
<Channel>Application</Channel>
<Computer>PC</Computer>
<Security />
</System>
- <EventData>
<Data>Microsoft.Alm.Shared.Remoting.RemoteContainer.dll</Data>
<Data>14.0.23107.0</Data>
<Data>559b78f2</Data>
<Data>KERNELBASE.dll</Data>
<Data>10.0.14393.0</Data>
<Data>57898e34</Data>
<Data>e0434352</Data>
<Data>000d96c2</Data>
<Data>19cc</Data>
<Data>01d1f9843068d6aa</Data>
<Data>C:\WINDOWS\Microsoft.Net\assembly\GAC_32\Microsoft.Alm.Shared.Remoting.RemoteContainer\v4.0_14.0.0.0__b03f5f7f11d50a3a\Microsoft.Alm.Shared.Remoting.RemoteContainer.dll</Data>
<Data>C:\WINDOWS\System32\KERNELBASE.dll</Data>
<Data>7d4ce7e2-ade2-4814-bb3e-84dfebb60b4e</Data>
<Data />
<Data />
</EventData>
</Event>
- <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="2016-08-18T19:10:34.561501300Z" />
<EventRecordID>3121</EventRecordID>
<Channel>Application</Channel>
<Computer>PC</Computer>
<Security />
</System>
- <EventData>
<Data>Application: Microsoft.Alm.Shared.Remoting.RemoteContainer.dll Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.InvalidOperationException at
System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) at
System.Diagnostics.Process.OpenProcessHandle(Int32 access) at
System.Diagnostics.Process.set_EnableRaisingEvents(Boolean value) at
Microsoft.Alm.Remoting.RemoteContainer.ServerHost.Execute(String clientObjectUri, Process parentProcess) at
Microsoft.Alm.Remoting.RemoteContainer.EntryPoint.ExecuteInOtherAppDomain(String clientObjectUri, Int32 parentProcessId) at
Microsoft.Alm.Remoting.RemoteContainer+EntryPoint.ExecuteInOtherAppDomain(System.String, Int32) at
Microsoft.Alm.Remoting.RemoteContainer+EntryPoint.Main(System.String[])</Data>
</EventData>
</Event>
I have a simple Windows Forms App. It was working alright before the update. Now it's not working. It starts as process but nothing more. No UI shows up. When I open the solution and choose some cs or designer files a loading message box shows saying "Opening the file..." and loads endlessly.
I have another simple launcher for the Mail App.
public static void Main()
{
Process.Start("explorer", #"shell:Appsfolder\microsoft.windowscommunicationsapps_8wekyb3d8bbwe!microsoft.windowslive.mail");
}
It's not working any more. O_o If I type the shell explorer shell:Appsfolder\microsoft.windowscommunicationsapps_8wekyb3d8bbwe!microsoft.windowslive.mail through Run it is working fine though. What have they done to the new Windows?

Getting an Error in my event log of Team Foundation Server

I don't know if this is the right place to ask this, but I'm getting an error in my eventlog every time I open my TFS webpage I get the following error:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft-Team Foundation Server" Guid="{80761876-6844-47D5-8106-F8ED2AA8687B}" />
<EventID>0</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>1</Task>
<Opcode>10</Opcode>
<Keywords>0x8000000000000001</Keywords>
<TimeCreated SystemTime="2016-02-24T14:48:40.361409100Z" />
<EventRecordID>650</EventRecordID>
<Correlation ActivityID="{72451AFD-6F04-0000-3340-4572046FD101}" />
<Execution ProcessID="3932" ThreadID="808" />
<Channel>Microsoft-Team Foundation Server/Debug</Channel>
<Computer>WIN-U8K4FA701IJ</Computer>
<Security UserID="S-1-5-19" />
</System>
<UserData>
<Info TraceId="{00000001-0001-0001-0000-000000000000}" xmlns="http://schemas.microsoft.com/TeamFoundation/2010/Framework">
<Tracepoint>599999</Tracepoint>
<ServiceHost>{00000000-0000-0000-0000-000000000000}</ServiceHost>
<ContextId>0</ContextId>
<ProcessName>w3wp</ProcessName>
<Username />
<Service />
<Method />
<Area>WebAccess</Area>
<Layer>Controller</Layer>
<UserAgent />
<Uri />
<Path />
<UserDefined />
<Message>System.Reflection.ReflectionTypeLoadException: Kan een of meer van de gevraagde typen niet laden. Haal de LoaderExceptions-eigenschap op voor meer informatie. bij System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) bij System.Reflection.RuntimeModule.GetTypes() bij System.Reflection.Assembly.GetTypes() bij Microsoft.TeamFoundation.Server.WebAccess.TypeUtils.GetAllTypes(IEnumerable`1 assemblies, Func`2 filter)</Message>
</Info>
</UserData>
</Event>
I tried re-installing everything but it didn't bother.
Who knows what is giving me this error?
First, translate the error message into English to make it readable:
<Message>System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at Microsoft.TeamFoundation.Server.WebAccess.TypeUtils.GetAllTypes(IEnumerable`1 assemblies, Func`2 filter)</Message>
This error may be caused by various factors, for example, if you don't configure build service well. Try to install the TFS 2012 Power Tools, then run the BPA to scan your TFS 2012 Server, you may get something useful.

Azure Hosted Service Bus : "The X.509 certificate CN=servicebus.windows.net is not in the trusted people store."

Using Azure SDK 2.3 on my vs2013 development VM I can consume Service Bus queues hosted in Azure painlessly. However, on Windows Server 2008 R2 Standard SP1, it looks like Windows can not trust the involved certificates and an exception is thrown.
The line that throws :
// Send the message
await queueclient.SendAsync(message);
Exception message :
The X.509 certificate CN=servicebus.windows.net is not in the trusted
people store. The X.509 certificate CN=servicebus.windows.net chain
building failed. The certificate that was used has a trust chain that
cannot be verified. Replace the certificate or change the
certificateValidationMode. A certificate chain could not be built to a
trusted root authority.
The CAPI2 logs (attached below) pointed to a trust issue so I compared certificates installed on both machines. The following certificates are absent on the server :
Intermediate Certification Authorities > Microsoft Internet Authority
(Issued by Baltimore CyberTrust Root)
Intermediate Certification Authorities > MSIT Machine Auth CA 2
(Issued by Microsoft Internet Authority)
The questions :
Where does the certificates come from?
Why are they missing from the server?
How to fix this issue?
Possible trails (updated) :
Install Azure SDK 2.3 for Visual Studio 2013 on the server
Install all Windows Updates on the server
I tried :
<appSettings>
<add key="Microsoft.ServiceBus.X509RevocationMode" value="NoCheck"/>
</appSettings>
CAPI2 Verify Chain Policy event :
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft-Windows-CAPI2" Guid="{5bbca4a8-b209-48dc-a8c7-b23d3e5216fb}" />
<EventID>30</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>30</Task>
<Opcode>0</Opcode>
<Keywords>0x4000000000000001</Keywords>
<TimeCreated SystemTime="2014-06-11T19:57:38.998656000Z" />
<EventRecordID>5642</EventRecordID>
<Correlation />
<Execution ProcessID="5280" ThreadID="8472" />
<Channel>Microsoft-Windows-CAPI2/Operational</Channel>
<Computer>ne-r026-310cn</Computer>
<Security UserID="S-1-5-82-1758914132-2364927631-3137608320-3227192193-3717738432" />
</System>
<UserData>
<CertVerifyCertificateChainPolicy>
<Policy type="CERT_CHAIN_POLICY_BASE" constant="1" />
<Certificate fileRef="3E560462C61B45BE1A59F1286B34A065A878AFA0.cer" subjectName="servicebus.windows.net" />
<CertificateChain chainRef="{19B5F58A-FA37-4213-A888-C81C340D019C}" />
<Flags value="1000" CERT_CHAIN_POLICY_IGNORE_PEER_TRUST_FLAG="true" />
<Status chainIndex="0" elementIndex="-1" />
<EventAuxInfo ProcessName="w3wp.exe" />
<CorrelationAuxInfo TaskId="{F8DE43DD-9E68-461E-8A2B-17215BA87E0C}" SeqNumber="1" />
<Result value="800B010A">A certificate chain could not be built to a trusted root authority.</Result>
</CertVerifyCertificateChainPolicy>
</UserData>
</Event>
CAPI2 Build Chain event :
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft-Windows-CAPI2" Guid="{5bbca4a8-b209-48dc-a8c7-b23d3e5216fb}" />
<EventID>11</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>11</Task>
<Opcode>2</Opcode>
<Keywords>0x4000000000000003</Keywords>
<TimeCreated SystemTime="2014-06-11T19:57:38.998656000Z" />
<EventRecordID>5641</EventRecordID>
<Correlation />
<Execution ProcessID="5280" ThreadID="8472" />
<Channel>Microsoft-Windows-CAPI2/Operational</Channel>
<Computer>ne-r026-310cn</Computer>
<Security UserID="S-1-5-82-1758914132-2364927631-3137608320-3227192193-3717738432" />
</System>
<UserData>
<CertGetCertificateChain>
<Certificate fileRef="3E560462C61B45BE1A59F1286B34A065A878AFA0.cer" subjectName="servicebus.windows.net" />
<ValidationTime>2014-06-11T19:57:38.998Z</ValidationTime>
<AdditionalStore />
<ExtendedKeyUsage />
<Flags value="0" />
<ChainEngineInfo context="machine" />
<AdditionalInfo>
<NetworkConnectivityStatus value="1" _SENSAPI_NETWORK_ALIVE_LAN="true" />
</AdditionalInfo>
<CertificateChain chainRef="{19B5F58A-FA37-4213-A888-C81C340D019C}">
<TrustStatus>
<ErrorStatus value="10000" CERT_TRUST_IS_PARTIAL_CHAIN="true" />
<InfoStatus value="0" />
</TrustStatus>
<ChainElement>
<Certificate fileRef="3E560462C61B45BE1A59F1286B34A065A878AFA0.cer" subjectName="servicebus.windows.net" />
<SignatureAlgorithm oid="1.2.840.113549.1.1.5" hashName="SHA1" publicKeyName="RSA" />
<PublicKeyAlgorithm oid="1.2.840.113549.1.1.1" publicKeyName="RSA" publicKeyLength="2048" />
<TrustStatus>
<ErrorStatus value="0" />
<InfoStatus value="2" CERT_TRUST_HAS_KEY_MATCH_ISSUER="true" />
</TrustStatus>
<ApplicationUsage>
<Usage oid="1.3.6.1.5.5.7.3.2" name="Client Authentication" />
<Usage oid="1.3.6.1.5.5.7.3.1" name="Server Authentication" />
</ApplicationUsage>
<IssuanceUsage />
</ChainElement>
</CertificateChain>
<EventAuxInfo ProcessName="w3wp.exe" />
<CorrelationAuxInfo TaskId="{9077AB4E-95E3-449B-AF2F-0BF42E92E6B7}" SeqNumber="11" />
<Result value="800B010A">A certificate chain could not be built to a trusted root authority.</Result>
</CertGetCertificateChain>
</UserData>
</Event>
CAPI2 X509 Objects event :
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft-Windows-CAPI2" Guid="{5bbca4a8-b209-48dc-a8c7-b23d3e5216fb}" />
<EventID>90</EventID>
<Version>0</Version>
<Level>4</Level>
<Task>90</Task>
<Opcode>0</Opcode>
<Keywords>0x4000000000000200</Keywords>
<TimeCreated SystemTime="2014-06-11T19:57:38.998656000Z" />
<EventRecordID>5640</EventRecordID>
<Correlation />
<Execution ProcessID="5280" ThreadID="8472" />
<Channel>Microsoft-Windows-CAPI2/Operational</Channel>
<Computer>ne-r026-310cn</Computer>
<Security UserID="S-1-5-82-1758914132-2364927631-3137608320-3227192193-3717738432" />
</System>
<UserData>
<X509Objects>
<Certificate fileRef="3E560462C61B45BE1A59F1286B34A065A878AFA0.cer" subjectName="servicebus.windows.net">
<Subject>
<CN>servicebus.windows.net</CN>
</Subject>
<SubjectKeyID computed="false" hash="BD41618C22D8DBEE9D172C12A2C549D61711ED75" />
<SignatureAlgorithm oid="1.2.840.113549.1.1.5" hashName="SHA1" publicKeyName="RSA" />
<PublicKeyAlgorithm oid="1.2.840.113549.1.1.1" publicKeyName="RSA" publicKeyLength="2048" />
<Issuer>
<CN>MSIT Machine Auth CA 2</CN>
<DC>redmond</DC>
<DC>corp</DC>
<DC>microsoft</DC>
<DC>com</DC>
</Issuer>
<SerialNumber>70DB015B000100008C58</SerialNumber>
<NotBefore>2013-07-27T03:31:06Z</NotBefore>
<NotAfter>2015-07-27T03:31:06Z</NotAfter>
<Extensions>
<KeyUsage value="B0" CERT_DIGITAL_SIGNATURE_KEY_USAGE="true" CERT_KEY_ENCIPHERMENT_KEY_USAGE="true" CERT_DATA_ENCIPHERMENT_KEY_USAGE="true" />
<ExtendedKeyUsage>
<Usage oid="1.3.6.1.5.5.7.3.2" name="Client Authentication" />
<Usage oid="1.3.6.1.5.5.7.3.1" name="Server Authentication" />
</ExtendedKeyUsage>
<SubjectAltName>
<DNSName>*.servicebus.windows.net</DNSName>
<DNSName>servicebus.windows.net</DNSName>
</SubjectAltName>
<AuthorityKeyIdentifier>
<KeyID hash="EBDB115EF8099ED8D6629CFD629DE3844A28E127" />
</AuthorityKeyIdentifier>
</Extensions>
</Certificate>
<EventAuxInfo ProcessName="w3wp.exe" />
<CorrelationAuxInfo TaskId="{9077AB4E-95E3-449B-AF2F-0BF42E92E6B7}" SeqNumber="10" />
</X509Objects>
</UserData>
</Event>
The missing certificates were responsible for the exception.
I haven't been able to find the certificates online and I'm still unsure of how EXACTLY they managed to install themselves BUT I think I have an idea..
How we managed to obtain the certificates?
We isolated the Service Bus messaging code into a console application and executed it with admin rights on the production server. The certificates installed themselves automatically in the process.
Perhaps our application pool, running under ApplicationPoolIdentity with limited permissions was not allowing Windows to download or install the certificates.
This link seems to offer related information : http://netsekure.org/2011/04/automatic-ca-root-certificate-updates-on-windows/
Update : You can download the certificate chain here.
To eliminate certificate trust issues from Service Bus for Windows Server, use the following:
Create a list of the certificates you trust:
var trustedCertificates = new HashSet<string>(new[]
{
"1245…",
"4567…,
"8102…"
}, StringComparer.OrdinalIgnoreCase);
Trust those:
ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) =>
{
if (errors == SslPolicyErrors.None)
{
return true;
}
var hashString = certificate.GetCertHashString();
var isTrusted = trustedCertificates.Contains(hashString);
if (!isTrusted)
{
telemetryClient.TrackTrace($"Untrusted: {hashString} Errors: {errors} Cert: {certificate.ToString()}", SeverityLevel.Warning);
}
return isTrusted;
};
Calm Service Bus down too:
private static void SetCertificateValidator()
{
var retriableCertificateValidatorType = Type.GetType("Microsoft.ServiceBus.Channels.Security.RetriableCertificateValidator, Microsoft.ServiceBus", true, false);
var instanceProperty = retriableCertificateValidatorType.GetProperty("Instance", BindingFlags.Static | BindingFlags.NonPublic);
var instance = instanceProperty.GetValue(null);
var peerOrChainTrustNoCheck = retriableCertificateValidatorType.GetField("peerOrChainTrustNoCheck", BindingFlags.Instance | BindingFlags.NonPublic);
peerOrChainTrustNoCheck?.SetValue(instance, new EmptyOpX509CertificateValidator());
}
private sealed class EmptyOpX509CertificateValidator : X509CertificateValidator
{
public override void Validate(X509Certificate2 certificate)
{
}
}

IIS response by 500 error after request by SOAP message (module ISAPI)

Hello when i try to request my web service deploied on IIS i get the response:
HTTP/1.1 500 Internal Server Error
Cache-Control: private
Content-Type: application/soap+xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Wed, 21 Dec 2011 12:53:36 GMT
Connection: close
I configured Failed Request Tracer for any modules and i hope to get detailed errors with stacktrace but I got only this:
....
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASPNET" Guid="{AFF081FE-0247-4275-9C4E-021F3DC1DA35}"/>
<EventID>0</EventID>
<Version>0</Version>
<Level>5</Level>
<Opcode>11</Opcode>
<Keywords>0x2</Keywords>
<TimeCreated SystemTime="2011-12-21T12:53:36.787Z"/>
<Correlation ActivityID="{00000000-0000-0000-0200-0080000000FB}"/>
<Execution ProcessID="4280" ThreadID="4952"/>
<Computer>LOBASTOV-A</Computer>
</System>
<EventData>
<Data Name="ConnID">20313736</Data>
<Data Name="Context ID">{00000000-0000-0000-0200-0080000000FB}</Data>
<Data Name="Data1">System.Web.Caching.OutputCacheModule</Data>
</EventData>
<RenderingInfo Culture="ru-RU">
<Opcode>AspNetPipelineLeave</Opcode>
<Keywords>
<Keyword>Module</Keyword>
</Keywords>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{06A01367-79D3-4594-8EB3-C721603C4679}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASPNET" Guid="{AFF081FE-0247-4275-9C4E-021F3DC1DA35}"/>
<EventID>0</EventID>
<Version>0</Version>
<Level>5</Level>
<Opcode>12</Opcode>
<Keywords>0x1</Keywords>
<TimeCreated SystemTime="2011-12-21T12:53:36.787Z"/>
<Correlation ActivityID="{00000000-0000-0000-0200-0080000000FB}"/>
<Execution ProcessID="4280" ThreadID="4952"/>
<Computer>LOBASTOV-A</Computer>
</System>
<EventData>
<Data Name="ConnID">20313736</Data>
<Data Name="Context ID">{00000000-0000-0000-0200-0080000000FB}</Data>
</EventData>
<RenderingInfo Culture="ru-RU">
<Opcode>AspNetMapHandlerEnter</Opcode>
<Keywords>
<Keyword>Infrastructure</Keyword>
</Keywords>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{06A01367-79D3-4594-8EB3-C721603C4679}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>3</Level>
<Opcode>16</Opcode>
<Keywords>0x100</Keywords>
<TimeCreated SystemTime="2011-12-21T12:53:36.896Z"/>
<Correlation ActivityID="{00000000-0000-0000-0200-0080000000FB}"/>
<Execution ProcessID="4280" ThreadID="4952"/>
<Computer>LOBASTOV-A</Computer>
</System>
<EventData>
<Data Name="ContextId">{00000000-0000-0000-0200-0080000000FB}</Data>
<Data Name="ModuleName">IsapiModule</Data>
<Data Name="Notification">128</Data>
<Data Name="HttpStatus">500</Data>
<Data Name="HttpReason">Internal Server Error</Data>
<Data Name="HttpSubStatus">0</Data>
<Data Name="ErrorCode">0</Data>
<Data Name="ConfigExceptionInfo"></Data>
</EventData>
<RenderingInfo Culture="ru-RU">
<Opcode>MODULE_SET_RESPONSE_ERROR_STATUS</Opcode>
<Keywords>
<Keyword>RequestNotifications</Keyword>
</Keywords>
<freb:Description Data="Notification">EXECUTE_REQUEST_HANDLER</freb:Description>
<freb:Description Data="ErrorCode">Операция успешно завершена.
(0x0)</freb:Description>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{002E91E3-E7AE-44AB-8E07-99230FFA6ADE}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>5</Level>
<Opcode>1</Opcode>
<Keywords>0x100</Keywords>
<TimeCreated SystemTime="2011-12-21T12:53:36.896Z"/>
<Correlation ActivityID="{00000000-0000-0000-0200-0080000000FB}"/>
<Execution ProcessID="4280" ThreadID="4952"/>
<Computer>LOBASTOV-A</Computer>
</System>
<EventData>
<Data Name="ContextId">{00000000-0000-0000-0200-0080000000FB}</Data>
<Data Name="ModuleName">WindowsAuthenticationModule</Data>
<Data Name="Notification">536870912</Data>
<Data Name="fIsPostNotification">false</Data>
</EventData>
<RenderingInfo Culture="ru-RU">
<Opcode>NOTIFY_MODULE_START</Opcode>
<Keywords>
<Keyword>RequestNotifications</Keyword>
</Keywords>
<freb:Description Data="Notification">SEND_RESPONSE</freb:Description>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{002E91E3-E7AE-44AB-8E07-99230FFA6ADE}</EventGuid>
</ExtendedTracingInfo>
</Event>
....
And here my SOAP request:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:updateBill xmlns:ns2="http://client.ishop.mw.ru/">
<login>test</login>
<password>test</password>
<txn>test</txn>
<status>1</status>
</ns2:updateBill>
</soap:Body>
</soap:Envelope>
Can anybody help me to understand what is wrang? Or say how to get the detailed errors with stacktrace?
Error 0x80070005 means ERROR_ACCESS_DENIED. The Roaming folder contains some CLR Security Config file. Try and check if the account under which the service is running has administrator permission (that should also solve access to the Tempor‌​ary Internet Files folder).
Please consider this as SOAP level error (as it is not a general IIS 500). Read the SOAP protocol in details, and you will see what may be the cause,
http://www.w3.org/TR/2007/REC-soap12-part0-20070427/
http://www.w3.org/TR/2007/REC-soap12-part2-20070427/
My guess is that the server application cannot process the SOAP requests.

Categories

Resources