“The type or namespace ‘Azure’ does not exist in the namespace ‘Microsoft’ – Visual Studio 2022.”

huangapple go评论74阅读模式
英文:

The type or namespace 'Azure' does not exist in the namespace 'Microsoft' - Visual Studio 2022

问题

I've just installed Visual Studio 2022 and I'm attempting to develop a BlobTrigger Azure function. As part of the default class that is created, the following namespaces are included:

using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Extensions.Logging;

However, red lines appear under each of these with the message:

The type or namespace 'Azure' does not exist in the namespace 'Microsoft'

Any ideas on what I might need to install to get this working?

英文:

I've just installed Visual Studio 2022 and I'm attempting to develop a BlobTrigger Azure function. As part of the default class that is created, the following namespaces are included:

using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Extensions.Logging;

However, red lines appear under each of these with the message:

The type or namespace 'Azure' does not exist in the namespace 'Microsoft' 

Any ideas on what I might need to install to get this working?

答案1

得分: 1

"The type or namespace 'Azure' does not exist in the namespace 'Microsoft'.

You should have the packages installed in your visual studio to use them in your application.

  • To install these packages, go to Tools > NuGet Package Manager > Package Manager Console, run the below given commands.
Install-Package Microsoft.Azure.WebJobs
Install-Package Microsoft.Azure.WebJobs.Host
Install-Package Microsoft.Extensions.Logging

“The type or namespace ‘Azure’ does not exist in the namespace ‘Microsoft’ – Visual Studio 2022.”

Or To install packages directly:
Go to Tools > NuGet Package Manager > Manage Nuget Packages for Solution.

“The type or namespace ‘Azure’ does not exist in the namespace ‘Microsoft’ – Visual Studio 2022.”


我已创建了一个示例的Blob触发Azure函数。

我通过移除环境中安装的包来重现了这个问题,结果是我遇到了相同的错误。

“The type or namespace ‘Azure’ does not exist in the namespace ‘Microsoft’ – Visual Studio 2022.”

在应用程序中安装了以下包之后,我能够修复错误并获得预期的结果。

“The type or namespace ‘Azure’ does not exist in the namespace ‘Microsoft’ – Visual Studio 2022.”

输出:

“The type or namespace ‘Azure’ does not exist in the namespace ‘Microsoft’ – Visual Studio 2022.”

“The type or namespace ‘Azure’ does not exist in the namespace ‘Microsoft’ – Visual Studio 2022.”

英文:

>The type or namespace 'Azure' does not exist in the namespace 'Microsoft'.

You should have the packages installed in your visual studio to use them in your application.

  • To install these packages, go to Tools > NuGet Package Manager > Package Manager Console, run the below given commands.
Install-Package Microsoft.Azure.WebJobs
Install-Package Microsoft.Azure.WebJobs.Host
Install-Package Microsoft.Extensions.Logging

“The type or namespace ‘Azure’ does not exist in the namespace ‘Microsoft’ – Visual Studio 2022.”

Or To install packages directly:
Go to Tools > NuGet Package Manager > Manage Nuget Packages for Solution.

“The type or namespace ‘Azure’ does not exist in the namespace ‘Microsoft’ – Visual Studio 2022.”


I have created a sample Blob Trigger Azure function.

I have reproduced the issue by removing the packages installed in my environment and I was getting the same error.

“The type or namespace ‘Azure’ does not exist in the namespace ‘Microsoft’ – Visual Studio 2022.”

After installing the below packages in application, I could fix the error and able to get the expected results.

“The type or namespace ‘Azure’ does not exist in the namespace ‘Microsoft’ – Visual Studio 2022.”

Output:

“The type or namespace ‘Azure’ does not exist in the namespace ‘Microsoft’ – Visual Studio 2022.”

“The type or namespace ‘Azure’ does not exist in the namespace ‘Microsoft’ – Visual Studio 2022.”

huangapple
  • 本文由 发表于 2023年3月3日 23:32:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/75629036.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定