我最近没有将C#dll添加到我的服务中,该服务充当HTTP客户端。在我的本地计算机(Windows 10)上,一切正常。当尝试在Azure上发送请求时,我得到以下响应。
<h3>There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.</h3>
DLL的开发人员和我调试(VS远程调试)App Service时,当我们首次尝试使用DllImport时,将发生此异常。他声称此时没有网络请求发送。但是,无论哪种方式,他都试图修复dll中的代理错误,但在Azure上仍然无法正常工作。dll取决于kernel.dll和msvcrt.dll应该不是问题吗?
在App Insight中,我同时收到此异常,我发送了请求,但是我不确定异常是否相关:启动程序集Microsoft.AspNetCore.AzureAppServices.HostingStartup无法执行。有关更多详细信息,请参见内部异常。无法加载文件或程序集'Microsoft.AspNetCore.AzureAppServices.HostingStartup,Culture = neutral,PublicKeyToken = null'。该系统找不到指定的文件。
系统信息:操作系统版本:Microsoft Windows NT 10.0.14393.0 64位系统:True 64位进程:False处理器数量:4
dll在具有正确版本的服务器上。
这里发生异常:
[DllImport(LIB_32, EntryPoint = SYMBOL_FREE)]
internal static extern void Free32(IntPtr response);
[DllImport(LIB_64, EntryPoint = SYMBOL_FREE)]
internal static extern void Free64(IntPtr response);
[DllImport(LIB_32, EntryPoint = SYMBOL_INVOKE)]
internal static extern IntPtr Invoke32([In] byte[] request);
[DllImport(LIB_64, EntryPoint = SYMBOL_INVOKE)]
internal static extern IntPtr Invoke64([In] byte[] request);
protected override IntPtr PerformInvokeForArchitecure(byte[] request)
{
if (Is64BitSystem)
{
return Invoke64(request);
}
return Invoke32(request);
}
无法解决此问题,因为我们无法直接在Azure上注册此dll,并且我无法成功尝试使用代码进行动态加载。建议使用Azure Container
或virtual machine
加载此dll。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句