Getting an Error in my event log of Team Foundation Server - c#

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.

Related

unhandled Exception 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>

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?

WCF debugging not able to understand

I am trying to debug a custom self hosted WCF service on production server (no visual studio, nothing..) I modified WCF service web.config and added tracelistener as described here, but all I am getting entries like this, which makes no sense
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>524324</EventID>
<Type>3</Type>
<SubType Name="Verbose">0</SubType>
<Level>16</Level>
<TimeCreated SystemTime="2014-06-27T13:55:07.6585544Z"/>
<Source Name="System.ServiceModel"/>
<Correlation ActivityID="{00000000-0000-0000-0000-000000000000}"/>
<Execution ProcessName="w3wp" ProcessID="4564" ThreadID="6"/>
<Channel/>
<Computer>SERVER-NAME</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Verbose">
<TraceIdentifier>http://msdn.microsoft.com/en-GB/library/System.ServiceModel.GetConfigurationSection.aspx</TraceIdentifier>
<Description>Get configuration section.</Description>
<AppDomain>/LM/W3SVC/2/ROOT/selfiehostie-1-1304834290733034307</AppDomain>
<ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/StringTraceRecord">
<ConfigurationSection>system.serviceModel/serviceHostingEnvironment</ConfigurationSection>
</ExtendedData>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>
Error I am getting
Getting 500 and The first 1024 bytes of the response, is it possible to get more bytes to see the real error ?
OR
What does above verbose errors means ?
How to find out why WCF service failing ?
Have you tried viewing your Trace.svclog file in Microsoft Service Trace Viewer?
It is usually easier to locate error this way, and it shows information in compact form.
If you cannot use that tool - try to look for <Exception> tag in trace.
500 server error usually indicates some error on server side, for example that server thrown exception.
EDIT:
You can also try to increase maximum logged message size:
<system.serviceModel>
<diagnostics>
<messageLogging
logMessagesAtTransportLevel="true"
logMessagesAtServiceLevel="false"
logMalformedMessages="true"
logEntireMessage="true"
maxSizeOfMessageToLog="100000"
maxMessagesToLog="100000" />
</diagnostics>

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)
{
}
}

Configuration evaluation context not found warning on WCF trace

I have a set of WCF services hosted on a .NET 4 application. I manually create the ServiceHost class and start listening on TCP port.
All works as expected but in the WCF trace on the server side I get the warning below.
Configuration evaluation context not found.
XML trace follows:
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>524312</EventID>
<Type>3</Type>
<SubType Name="Warning">0</SubType>
<Level>4</Level>
<TimeCreated SystemTime="2010-09-03T12:33:01.9404010Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
<Execution ProcessName="Server.Console.vshost" ProcessID="24612" ThreadID="10" />
<Channel />
<Computer>BAROLO</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Warning">
<TraceIdentifier>http://msdn.microsoft.com/it-IT/library/System.ServiceModel.EvaluationContextNotFound.aspx</TraceIdentifier>
<Description>Configuration evaluation context not found.</Description>
<AppDomain>Server.Console.vshost.exe</AppDomain>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>
Any idea about the reason of the warning?
Thanks
Did you take a look at that MSDN blog: Missing Binding Extensions?
The evaluation context not found error (or in traces with the identifier System.ServiceModel.EvaluationContextNotFound) is generally caused by using a configuration element defined in a library that is not included in the application’s configuration as an extension.
My experience is, you have to manually create service with service name and other details under tag.
e.g.
<system.serviceModel>
<services>
<service name="WCF_NameSpace.Service1" behaviorConfiguration="behave">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="bind" contract="WCF_Trace_2.IService1"></endpoint>
</service>
</services>

Categories

Resources