gpt4 book ai didi

.net-core - Xamarin.Mac https ://localhost httplclient

转载 作者:行者123 更新时间:2023-12-05 05:06:15 24 4
gpt4 key购买 nike

我有一个本地 webapi,我使用自签名证书在 pc 上运行。我能够使用浏览器(https://localhost:port/controller/method)访问 webapi(用 .net 核心编写),但是当我在 Mac 上使用 httpclient 时OS Mojave 我得到一个异常(exception)(High Sierra 和 Catalina 工作)。

System.DllNotFoundException: libc.dylib assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) System.Net.NetworkInformation.CommonUnixIPGlobalProperties.getdomainname(byte[],int)
at System.Net.NetworkInformation.CommonUnixIPGlobalProperties.get_DomainName () [0x0000b] in <4b9a7f543fd447a3be5e54f34ee219b2>:0
at System.Net.CookieContainer..ctor () [0x0003f] in <4b9a7f543fd447a3be5e54f34ee219b2>:0
at System.Net.Http.MonoWebRequestHandler.get_CookieContainer () [0x0000a] in <e45d721af82a41d98156aeda80e9ce53>:0
at System.Net.Http.MonoWebRequestHandler.CreateWebRequest (System.Net.Http.HttpRequestMessage request) [0x000f5] in <e45d721af82a41d98156aeda80e9ce53>:0
at System.Net.Http.MonoWebRequestHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x0003e] in <e45d721af82a41d98156aeda80e9ce53>:0
at System.Net.Http.HttpClient.SendAsyncWorker (System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken) [0x000e8] in <e45d721af82a41d98156aeda80e9ce53>:0
at Mac_Installer.ViewController.Timer_Elapsed (System.Object sender, System.Timers.ElapsedEventArgs e) [0x000bd] in <3581d802103c47bbbf47f26a2763b24c>:0

我已阅读,似乎我需要将 DYLD_FALLBACK_LIBRARY_PATH 设置为 /usr/lib(我可以看到文件 - libc.dylib - 在那里) , 相信我应该将它作为环境变量添加到 info.plist 中,但它仍然失败,或者我做错了。

感谢任何帮助。

最佳答案

如果您启用了强化运行时,请尝试将“允许 DYLD 环境变量授权”(com.apple.security.cs.allow-dyld-environment-variables) 添加到您的 Entitlements.plist 中。

关于.net-core - Xamarin.Mac https ://localhost httplclient,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59986429/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com