Visual Studio 2017 – Enterprise restarts on .Net Core Projects

那年仲夏 提交于 2021-02-10 14:48:12

问题


Just installed Visual Studio 2017 – Enterprise Edition with the following workloads:

  1. Universal Windows Platform Development
  2. ASP.Net and Web Development
  3. .Net Desktop Development
  4. .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:

  1. Download NuGet

    https://dist.nuget.org/win-x86-commandline/latest/nuget.exe

  2. Open the command prompt as “Administrator” – this is important other cache may not get cleared due to permission issues.

  3. Navigate to the folder where the NuGet is downloaded

  4. Run the following command to clear the cache

    nuget locals all -clear

  5. Open Visual Studio 2017

  6. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!