【发布时间】:2023-01-04 07:15:41
【问题描述】:
我试着遵循这个指南: https://www.allhandsontech.com/programming/dotnet/how-to-qr-code-generator-azure-functions/
但是,我遇到了这个问题:
C:\Users\SEB>cd System.Private.CoreLib: Exception while executing function: GenerateQRCode. QrCodeGenerator: Value cannot be null.
The filename, directory name, or volume label syntax is incorrect.
C:\Users\SEB>cd C:\Users\SEB\repos\QrCodeGen
C:\Users\SEB\repos\QrCodeGen>func start
Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date for restore.
C:\Users\SEB\repos\QrCodeGen\QRCodeGen.cs(22,21): error CS0103: The name 'QrCode' does not exist in the current context [C:\Users\SEB\repos\QrCodeGen\QRCodeGen.csproj]
C:\Users\SEB\repos\QrCodeGen\QRCodeGen.cs(22,47): error CS0103: The name 'QrCode' does not exist in the current context [C:\Users\SEB\repos\QrCodeGen\QRCodeGen.csproj]
C:\Users\SEB\repos\QrCodeGen\QRCodeGen.cs(16,49): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [C:\Users\SEB\repos\QrCodeGen\QRCodeGen.csproj]
构建失败。
C:\Users\SEB\repos\QrCodeGen\QRCodeGen.cs(16,49): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [C:\Users\SEB\repos\QrCodeGen\QRCodeGen.csproj]
C:\Users\SEB\repos\QrCodeGen\QRCodeGen.cs(22,21): error CS0103: The name 'QrCode' does not exist in the current context [C:\Users\SEB\repos\QrCodeGen\QRCodeGen.csproj]
C:\Users\SEB\repos\QrCodeGen\QRCodeGen.cs(22,47): error CS0103: The name 'QrCode' does not exist in the current context [C:\Users\SEB\repos\QrCodeGen\QRCodeGen.csproj]
1 Warning(s)
2 Error(s)
很抱歉这个菜鸟问题,如果有人能指出我正确的方向,那就太好了。谢谢!
【问题讨论】:
-
我们不知道您是否严格按照教程进行操作。 Please provide a [minimal, reproducible example 其他人可以使用它来重现您面临的问题。
标签: c# azure function async-await