I have created new ASP .Net Core app named 'BankAccount' and when i used to create controller of type 'API controller with actions , using Entity Framework', it gives me the following error => There was an error running the selected code generator: 'Package restore failed'.Rolling back package changes for 'BankAccount'
Here is the version of all my dependencies
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="2.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration" Version="2.1.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.0" />
</ItemGroup>
</Project>
This is Visual Studio 2019 Preview Version and here is screenshot of the error:
Microsoft.VisualStudio.Web.CodeGeneration
andMicrosoft.VisualStudio.Web.CodeGeneration
. try to change their version. – Muhammad AftabMicrosoft.VisualStudio.Web.Design
– Muhammad Aftab