我尝试使用包含一些 WPF 控件的 Azure 函数 v1。而 Azure funtion v1 支持 .Net 框架,它应该适用于 windows 环境。每当调试器到达 WPF 控件时,抛出异常表明
“InvalidOperationException:调用线程必须是STA,因为很多UI组件都需要这个。”
这就是我的代码的样子,我在浏览器中测试了该功能。
[FunctionName("Report1")]
public static async Task<HttpResponseMessage> RunReport([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = "hash/{hash1}")]HttpRequestMessage req, string hash1, TraceWriter log, Microsoft.Azure.WebJobs.ExecutionContext context){}