System could not be found Visual Studio 2017 ASP.NET Core project

前端 未结 20 1673
太阳男子
太阳男子 2020-12-14 05:50

I\'ve installed the newly released version of Visual Studio 2017 and started a fresh ASP.NET Core project targeting .NET Core.

Out of the box, I\'m getting the

相关标签:
20条回答
  • 2020-12-14 06:13

    I've tried all answers above. For me works only removal and adding the reference again described in the following steps:

    1. Open 'References' under the project.
    2. Right click on 'System' reference.
    3. Click on 'Remove'.
    4. Right click on 'References'.
    5. Click 'Add Reference...'.
    6. From right menu choose an 'Assemblies',
    7. In a search field type 'System'.
    8. Choose 'System' from the list.
    9. Click 'Add' button.
    10. IMPORTANT: Restart the Visual Studio.

    'System' reference you can replace with any you need.

    0 讨论(0)
  • 2020-12-14 06:13

    Not quite sure in which order vs 2017 trying to resolve packages. But my situation was following. In my VS2015 I had configured local and 3rd party source for nuget packages, newly installed version of 2017 loaded them too.

    https://api.nuget.org/v3/index.json was first in list.

    But vs2017 throwed an error that it can't restore .net core libraries from my another local repo.

    After I unchecked all of them except https://api.nuget.org/v3/index.json, it had started to working normally.

    0 讨论(0)
  • 2020-12-14 06:14

    For me the problem was caused by my project having a custom IntermediateOutputPath. For some reason, if project_name.csproj.nuget.g.targets is not in obj subfolder of project folder, the error occurs.

    Using default IntermediateOutputPath or keeping a shadow copy of project_name.csproj.nuget.g.targets in fake obj folder solves the problem for me.

    0 讨论(0)
  • 2020-12-14 06:15

    Check the version .NET Command Line Tools in CMD, just type dotnet --info. If version is 1.0.0, then try to install latest version .NET Core SDK from here.

    0 讨论(0)
  • 2020-12-14 06:18

    The problem for me occurred when running my Visual Studio as Admin with a separate user-- I had created a Git Repo with the source files in the user documents of my normal account. When I created a new solution in that folder the above errors occurred. Try creating your project in a different place and see if the error still occurs.

    0 讨论(0)
  • 2020-12-14 06:20

    Multiple closing and reopening of VS2017 fixed it for me.

    0 讨论(0)
提交回复
热议问题