【发布时间】:2019-11-16 15:48:24
【问题描述】:
尝试从我的函数应用程序建立一个到第三方 Web 服务的 xmlrpc。它在本地主机上运行良好,实际上,它在其他功能中也能运行,但是当发布到 Azure 时出现此错误:
System.MissingMethodException: Method not found: 'System.Reflection.Emit.AssemblyBuilder System.AppDomain.DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess)'.
at CookComputing.XmlRpc.XmlRpcProxyGen.BuildAssembly(Type itf, String assemblyName, String moduleName, String typeName, AssemblyBuilderAccess access)
at CookComputing.XmlRpc.XmlRpcProxyGen.Create(Type itf)
at CookComputing.XmlRpc.XmlRpcProxyGen.Create[T]()
在这一行失败了:
_serviceClient = XmlRpcProxyGen.Create<IServiceClient>();
IServiceClient 是一个如下所示的接口:
using CookComputing.XmlRpc;
using System;
namespace App.Core.Helpers.Service
{
[XmlRpcUrl("https://some.url")]
public interface IServiceClient : IXmlRpcProxy
// methods
}
我已手动将 System.Reflection.Emit 包添加到解决方案中以尝试修复它,但没有任何乐趣。完全相同的代码在我们在 Azure 中的其他应用程序中运行良好。该应用正在运行 .Net 框架 4.6.1。
【问题讨论】: