0

I have created a very basic (default) function app using Visual Studio by following MS Docs-

Installed the packages according to the doc only.

After I created a new function app , I am seeing this errors -

enter image description here

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?

Indrajeet Singh
  • 115
  • 2
  • 12
  • https://stackoverflow.com/questions/41169794/error-cs0234-the-type-or-namespace-name-aspnetcore-does-not-exist-in-the-name have you tried answers and comments from this queetion? – Saplu May 05 '21 at 18:32
  • Try to restore the nuget package. It seems you are not able to restore the package. – Rahul Shukla May 05 '21 at 19:36

2 Answers2

1

It looks like you do not have the required nuget packages installed.

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

The picture in the article shows the "Microsoft.AspNet.Mvc" package

Shiraz Bhaiji
  • 60,773
  • 31
  • 133
  • 239
1

Please check if you have the following Nuget-Package in the Dependencies.

enter image description here

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.

enter image description here

If you already have the Nuget-package Microsoft.NET.Sdk.Functions, please find it in the Installed tab and reinstall it.

enter image description here

Jack J Jun - MSFT
  • 4,051
  • 1
  • 4
  • 16