Aspnet-api-versioning: ASP.NET Core - Cannot resolve symbol 'AddApiVersioning'

Created on 23 Jul 2017  路  6Comments  路  Source: microsoft/aspnet-api-versioning

With a brand new ASP.NET Core project targeting Microsoft.AspNetCore 1.1.2 and Microsoft.AspNetCore.Mvc 1.1.3 I get Cannot resolve symbol 'AddApiVersioning' when trying to replicate the Basic sample project.

Not entirely sure what I'm doing wrong, it just doesn't seem to be able to resolve that call.

answered asp.net core question

Most helpful comment

Make sure to include the correct nuget packages. There are

  • Microsoft.AspNetCore.Mvc.ApiExplorer
  • Microsoft.AspNetCore.Mvc.Versioning
  • Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer

All 6 comments

I had similar issue. I resolve it by restarting VisualStudio2017

Occasionally VS has this problem. Restarting VS might work as @krychuq1 suggested. I usually find that the sure fire way to make things restore is to run:

dotnet restore
dotnet build

You can run the CLI from any project folder or the root of the solution. If you choose the root, you need to specify a *.sln since there are two.

Let me know if none of those options work for you.

Make sure to include the correct nuget packages. There are

  • Microsoft.AspNetCore.Mvc.ApiExplorer
  • Microsoft.AspNetCore.Mvc.Versioning
  • Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer

@lyptt were you able to get things working?

I have the impression that this issue is resolved. If it's not, feel free to reopen it or submit a new issue. Thanks.

Hi @commonsensesoftware, sorry for the late response. This was a VS issue, restarting VS fixed it as you mentioned above. Thanks!

Was this page helpful?
0 / 5 - 0 ratings