Home:ALL Converter>Visual Studio has NuGet errors if the project is part of a Git repository

Visual Studio has NuGet errors if the project is part of a Git repository

Ask Time:2020-02-03T07:17:56         Author:W1k3

Json Formatter

I downloaded an ASP.Net Boilerplate sample for core 3.0 with React. I built the aspnet-core solution successfully using Visual Studio 2019.

I need to get this project into a Git repository. I cloned the empty repo on to my computer and moved the project into the repo folder. Now when I open the project I'm greeted with the "One-way upgrade" screen to modify the EntityFrameworkCore project. After a successful project migration and I am able to open the project, none of the projects build and all produce a NETSDK1 error due to a missing project.assets.json file. If I try to run a NuGet restore, I get a new error with this description: Error occurred while restoring NuGet packages: '' is not a valid version string.

In addition to the project migration and the missing file errors, there are many missing dependency warnings in all the projects which I don't understand the meaning of.

The only difference Between the successful project and the one with all the problems is that if the project is inside a local Git repository on my computer. I can extract the sample directly into a Git repo folder or into any other folder on my computer and I will get two different results.

Visual Studio is clearly treating the solution differently if it is inside the repository. I have always added projects to Git repositories this way without these problems and am unaware of a different methodology.

Author:W1k3,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/60031518/visual-studio-has-nuget-errors-if-the-project-is-part-of-a-git-repository
yy