简体   繁体   English

命名空间“Microsoft”中不存在类型或命名空间名称“AspNetCore”

[英]The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft'

I have created a very basic (default) function app using Visual Studio by following MS Docs -我按照MS Docs使用 Visual Studio 创建了一个非常基本的(默认)function 应用程序 -

Installed the packages according to the doc only.仅根据文档安装软件包。

After I created a new function app, I am seeing this errors -在我创建了一个新的 function 应用程序后,我看到了这个错误 -

在此处输入图像描述

csproj csproj

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <AzureFunctionsVersion>v3</AzureFunctionsVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.11" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
</Project>

Let me know if anything else I need to provide?让我知道我是否需要提供其他任何东西?

It looks like you do not have the required nuget packages installed.看起来您没有安装所需的 nuget 软件包。

Use the "Manage packages for the solution" to install the missing packages.使用“管理解决方案的包”来安装缺少的包。

See: https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio#manage-packages-for-the-solution请参阅: https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio#manage-packages-for-the-solution

The picture in the article shows the "Microsoft.AspNet.Mvc" package文中图片为“Microsoft.AspNet.Mvc”package

Please check if you have the following Nuget-Package in the Dependencies.请检查依赖项中是否有以下Nuget-Package

在此处输入图像描述

If you don't have the Nuget-package Microsoft.NET.Sdk.Functions , please right-click Packages->Manage Nuget-package->Search the package and install it.如果您没有Nuget-package Microsoft.NET.Sdk.Functions ,请右键单击 Packages->Manage Nuget-package->搜索 package 并安装它。

在此处输入图像描述

If you already have the Nuget-package Microsoft.NET.Sdk.Functions , please find it in the Installed tab and reinstall it.如果您已经拥有Nuget-package Microsoft.NET.Sdk.Functions ,请在已安装选项卡中找到它并重新安装。

在此处输入图像描述

暂无
暂无

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

相关问题 命名空间“Microsoft.AspNetCore”中不存在类型或命名空间“OData” - The type or namespace 'OData' does not exist in the namespace 'Microsoft.AspNetCore' Blazor:命名空间“Microsoft.AspNetCore.Mvc.ApplicationParts”中不存在类型或命名空间名称“ApplicationPartAttributeAttribute” - Blazor: The type or namespace name 'ApplicationPartAttributeAttribute' does not exist in the namespace 'Microsoft.AspNetCore.Mvc.ApplicationParts' 命名空间“Microsoft.AspNetCore”中不存在类型或命名空间名称“Mvc”(您是否缺少程序集引用?) - The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?) 类型或名称空间名称“ AzureAD”在名称空间“ Microsoft.AspNetCore.Authentication”中不存在 - The type or namespace name 'AzureAD' does not exist in the namespace 'Microsoft.AspNetCore.Authentication' 命名空间“Microsoft.AspNetCore.Razor”中不存在类型或命名空间名称“Hosting” - The type or namespace name 'Hosting' does not exist in the namespace 'Microsoft.AspNetCore.Razor' 命名空间“Microsoft”中不存在类型或命名空间名称“AspNetCore”(您是否缺少程序集引用?) - The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) 命名空间“Microsoft.AspNetCore.Mvc.Razor”中不存在类型或命名空间名称“RuntimeCompilation” - the type or namespace name 'RuntimeCompilation' does not exist in the namespace 'Microsoft.AspNetCore.Mvc.Razor' 命名空间“Microsoft”中不存在类型或命名空间名称“TeamFoundation” - The type or namespace name 'TeamFoundation' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“Azure” - The type or namespace name 'Azure' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“ServiceBus”? - The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft'?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM