• 1000
Когда я запускаю программу со средой выполнения do tnet 2.1.13 , она игнорирует файл System. Net .NetworkInformation при выполнении запроса. Вот ожидаемая трассировка стека при отладке для do tnet runtime:
EXPECTED:
No Title
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Runtime.Serialization.Primitives.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Net.Requests.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Collections.NonGeneric.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Net.Security.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Web.HttpUtility.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Net.ServicePoint.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Net.WebHeaderCollection.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Net.Http.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Net.NetworkInformation.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\Microsoft.Win32.Primitives.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Security.Cryptography.Encoding.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Security.Principal.Windows.dll>'. Symbol loading disabled by Include/Exclude setting.
ACTUAL:
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Runtime.Serialization.Primitives.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Net.Requests.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Collections.NonGeneric.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Net.Security.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Web.HttpUtility.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Net.ServicePoint.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Net.WebHeaderCollection.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Net.Http.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\Microsoft.Win32.Primitives.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Security.Cryptography.Encoding.dll>'. Symbol loading disabled by Include/Exclude setting.
'dotnet.exe' (CoreCLR: clrhost): Loaded '<C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.13\System.Security.Principal.Windows.dll>'. Symbol loading disabled by Include/Exclude setting.
Проблема в том, что выполняется запрос на отдых на другой IP-адрес вместо тех, что упомянуты в файле хоста для данного DNS, т.е. IP-адреса из файла хоста игнорируются во время выполнения.
Я также создал Ping в командной строке и визуальную студию для DNS, IP-адреса в обоих случаях были из файла хоста. HTTP-запрос также работает в Postman и Eclipse . Я сравнил свою конфигурацию и переменные среды для Visual Studio и windows с моим коллегой. Пока не повезло. Вот почему я пришел сюда за ответом.