Razor页面@functions中的异步

我的剃须刀页面出现以下错误。

Razor页面@functions中的异步

所以我改变了。

Razor页面@functions中的异步

现在代码将运行,但是我得到警告。

  

1> obj \ Debug \ netcoreapp3.0 \ Razor \ Pages \ Areas.cshtml.g.cs(256,200,256,202):警告CS1998:此异步方法缺少'await'运算符,将同步运行。考虑使用'await'操作符来等待非阻塞API调用,或使用'await Task.Run(...)'在后台线程上进行CPU绑定的工作。
  1> obj \ Debug \ netcoreapp3.0 \ Razor \ Pages \ Areas.cshtml.g.cs(282,282,202):警告CS1998:此异步方法缺少'await'运算符,将同步运行。考虑使用“ await”运算符来等待非阻塞API调用,或者使用“ await Task.Run(...)”来在后台线程上执行CPU绑定的工作。

有人可以告诉我Razor Pages到底需要什么吗?

更新:

这是我完整的gtag('event','purchase',{ "transaction_id": "24.031608523954162","affiliation": "Google online store","value": 23.07,"currency": "USD","tax": 1.24,"shipping": 0,"items": [ { "id": "P12345","name": "Android Warhol T-Shirt","list_name": "Search Results","brand": "Google","category": "Product Group A","variant": "Black","list_position": 1,"quantity": 2,"price": '2.0' },{ "id": "P67890","name": "flame challenge TShirt","brand": "MyBrand","category": "Product Group B","variant": "Red","list_position": 2,"quantity": 1,"price": '3.0' } ] }); 部分。

#define UTOS32(a) ((union { uint32_t u; int32_t i; }){ .u = (a) }.i)

int32_t difference = UTOS32(timestamp1 - timestamp2);
nihaoguduzi 回答:Razor页面@functions中的异步

第一个是错误,第二个是警告。

This is the change实现了第一条错误消息。所以这当然是故意的。

我怀疑警告是由于未在方法内的任何地方看到单词await以及不了解~/导致隐式await导致的。因此,我认为这可能是Bug和should be reported to Microsoft

但是目前,除了忽略警告,我认为您别无选择。

本文链接:https://www.f2er.com/3141964.html

大家都在问