I have a C# .NET program (4.7.1) which I want to use the default system proxy if one is available.
When I put the following code in my App.Config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
</defaultProxy>
</system.net>
... rest of the file
</configuration>
The application crashes on startup in KERNELBASE.dll with no error and exits immediately.
I have setup a proxy on localhost using fiddler (to do some testing)
I can find the following error in the event logs which is not very useful:
Faulting application name: myprogram.exe, version: 0.01.6652.23883, time stamp: 0x5aaf246f
Faulting module name: KERNELBASE.dll, version: 10.0.16299.15, time stamp: 0x2cd1ce3d
Exception code: 0xe0434352
Fault offset: 0x001008b2
Faulting process id: 0x1220
Faulting application start time: 0x01d3bf2e95ca9d05
Faulting application path: C:\source\myprogram.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: 5a60273b-637f-4dac-ae09-5539fb563884
Faulting package full name:
Faulting package-relative application ID:
Any ideas where I am going wrong and how to get default proxy working in a C# .NET program?