简体   繁体   English

带有 WPF 控件的 Azure Function V1

[英]Azure Function V1 with WPF Controls

I tried to use Azure function v1 that contains some WPF controls.我尝试使用包含一些 WPF 控件的 Azure 函数 v1。 while Azure funtion v1 supports .Net framework, and it is supposed to work with windows environment.而 Azure 功能 v1 支持 .Net 框架,它应该在 windows 环境下工作。 whenever the debugger reaches the WPF control, exception is being thrown shows that每当调试器到达 WPF 控件时,都会抛出异常表明

"InvalidOperationException: The calling thread must be STA, because many UI components require this. " “InvalidOperationException:调用线程必须是 STA,因为很多 UI 组件都需要这个。”

This is how my code looks like, I tested the function within browser.这是我的代码的样子,我在浏览器中测试了该功能。

 [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){}

Dont have this usage method, Azure Function does not support UI.没有这个使用方法,Azure Function 不支持 UI。 WPF controls should not be handled in Azure Functions. WPF 控件不应在 Azure Functions 中处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM