当我添加异步时无法找到System.Runtime

狂怒

我正在做一个Azure函数,我需要它来做一些异步工作。但是我收到一个奇怪的错误,System.Runtime一旦调用一个等待的方法就无法加载程序集

[FunctionName("MyTestFunction")]
async public static void Run(
    [ServiceBusTrigger("testtopic", "testsubscription", AccessRights.Listen, Connection = "MyServiceBusConnection")]
    string mySbMsg,
    TraceWriter log)
{
    client = new DocumentClient(new System.Uri(ENDPOINT), ENDPOINT_KEY);
    await client.CreateDocumentAsync(UriFactory.CreateDocumentCollectionUri(DATABASE, COLLECTION_ID), string.Format("{ \"newmessage\": {0} }", mySbMsg));

    log.Info($"C# ServiceBus topic trigger function processed message: {mySbMsg}");
}

我在这里想念什么?

乡村

有一个解决此问题的方法-请查看此示例

使用Azure Function内置功能似乎更容易,并且不需要您等待任何事情,这可以解决您的问题。

此外,DocumentClient类旨在实例化一次,并在应用程序的整个生命周期中重复使用。请看一下本文-不正确的实例化反模式

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Amazon.Runtime.AmazonServiceException:无法找到凭证

无法找到Java Runtime Android Studio Robolectric

无法找到Java Uno RunTime(伪装)源

System.Runtime.Extensions需要更高版本的System.Runtime

Babel和Webpack抛出“无法解析'regenerator-runtime / runtime'”

Java Runtime.exec()异步输出

黄瓜.runtime.CucumberException:未找到后端

生成错误:您必须添加对System.Runtime的引用

我无法在.net 4.7项目中使用System.Runtime 4.3.0

完全无法定义System.Runtime.Caching的UpdateCallback

“无法解决T [] modreq(System.Runtime.CompilerServices.IsVolatile)”

FSharp Interactive无法启动;找不到System.Runtime.dll

.NET Framework:如何更新 System.Runtime?

Roslyn没有对System.Runtime的引用

错误:“ System.Runtime.InteropServices.SEHException”

System Guard Runtime Monitor Broker 服务问题

使用服务结构时出现 System.Runtime.InteropServices.COMException

使用Java的Runtime.exec()时如何添加超时值?

无法通过 Runtime.exec 运行命令

Java-Runtime.exec()无法运行

Java Runtime无法在Mac上捕获STDOUT

java Runtime exec进程无法正常运行

Java Runtime exec()无法正确转义字符

无法加载runtime-gdb.py

无法解析模块`@ babel / runtime / helpers / interopRequireDefault`

Java Runtime exec()无法正常工作

pm2-runtime 无法启动集群

Runtime.getRuntime.exec()无法正常工作

如何使用 babel 7.5 + runtime + plugin-transform-runtime 修复 regeneratorRuntime 错误异步方法