Aspnetcore: Cannot open Mvc.sln in visual studio 2019 community edition

Created on 3 Nov 2019  路  6Comments  路  Source: dotnet/aspnetcore

Cloned https://github.com/aspnet/AspNetCore.git from github.com and when tried to run Restore from Command prompt, getting the following error

C:\AspNetCore.tools\msbuild\16.0.0-alpha\tools\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk

Tried to open Mvc.sln in visual studio 2019 community edition, but none of the projects in the solution are loaded.

I would appreciate if anyone knows how to resolve this issue.

area-infrastructure

Most helpful comment

The error message usually indicates that you don't have the C++ workloads installed in VS. Portions of ASP.NET Core, such as MVC, Blazor, SignalR etc, do not require ANCM to build and their solutions can be opened without having the workloads installed \ ANCM built. However if you do want to get clean builds, the instructions https://github.com/aspnet/AspNetCore/blob/master/docs/BuildFromSource.md include a command for installing VS with the required workloads.

All 6 comments

@AVin9 have you had a look at the build from source instructions here: https://github.com/aspnet/AspNetCore/blob/master/docs/BuildFromSource.md?

Thanks for responding to this issue.

Followed the instruction in the link.

Everything worked fine until startvs.cmd command in the link (Restore.cmd worked fine without any problems)

But running startvs.cmd Mvc.Sln in the command prompt didn't open the visual studio solution. Instead it opens another command prompt with the physical path of Mvc.Sln as the title bar of the new command prompt window.

Tried to open Mvc.sln in visual studio 2019 community edition directly, the solution loaded without any error.

But building the solution gave the error 'The types in 'Microsoft.AspNetCore.Components.RenderTree' are not recommended for use outside of the Blazor framework. These type definitions will change in future releases.

Does anyone know how to resolve this issue?

I am also trying to build the project. I cloned and when I tried to run .\restore.cmd, I got following error:

E:\OpenSource\AspNetCore\src\Servers\IIS\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj(31,3): error MSB4019: The imported project "E:\OpenSource\AspNetCore.tools\msbuild\16.3.0-alpha\tools\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

There were many, but all related to the same path ".tools\msbuild\16.3.0-alpha\tools\MSBuild\Microsoft\VC\v160\". I checked this path in the downloaded repo, and it not there, so it's not downloaded by the restore command.

Did anyone resolve this issue yet?
.

I also ran into this issue:

<ROOT>\AspNetCore\.tools\msbuild\16.3.0-alpha\tools\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

The error message usually indicates that you don't have the C++ workloads installed in VS. Portions of ASP.NET Core, such as MVC, Blazor, SignalR etc, do not require ANCM to build and their solutions can be opened without having the workloads installed \ ANCM built. However if you do want to get clean builds, the instructions https://github.com/aspnet/AspNetCore/blob/master/docs/BuildFromSource.md include a command for installing VS with the required workloads.

Thanks, @pranavkm , VS 2019 Community was already installed on my system, but I updated it using below command:

PS> ./eng/scripts/InstallVisualStudio.ps1 -Edition Community

And after that .\restore.cmd run successfully.

Was this page helpful?
0 / 5 - 0 ratings