问题
Just installed Visual Studio 2017 – Enterprise Edition with the following workloads:
- Universal Windows Platform Development
- ASP.Net and Web Development
- .Net Desktop Development
- .Net Core cross-platform Development
After this installation, when I create a new .net core or .net standard project, the visual studio restarts while loading the project template. Steps to create the behavior:
File ⇒ New Project ⇒ .Net Core ⇒ Asp.Net Core Application (.Net Core)
Visual Studio tries to load the selected template then suddenly it disappears and the windows show the dialogue box to Check online help, debug or close it. Next, visual studio reboots to the start page.
This only happens when I select any .Net Core or .Net Standard project templates. Much appreciate your help in advance.
回答1:
I had the exact same issue. It turned out that when a .Net core or .Net standard project template is selected, it tries to restore the packages from NuGet and somehow it was unable to do that or clear the NuGet’s local cache. Here are the steps to fix it:
Download NuGet
https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
Open the command prompt as “Administrator” – this is important other cache may not get cleared due to permission issues.
Navigate to the folder where the NuGet is downloaded
Run the following command to clear the cache
nuget locals all -clear
Open Visual Studio 2017
Create a new ASP.Net core project with default templates
Hope this helps!
来源:https://stackoverflow.com/questions/43167300/visual-studio-2017-enterprise-restarts-on-net-core-projects