c# - Nuget restore error: This folder contains more than one solution file -
i have structure of solutions , projects:
projects |--.nuget | |--packages.config | |--projfoldera | |--projecta.csproj | |--projfolderb | |--projectb.csproj | |--projfolderc | |--projectc.csproj | |--solutionab.sln |--solutionbc.sln |--solutionca.sln
each solution configured use libraries using nuget. now, when run:nuget restore
, got error: this folder contains more 1 solution file.
if open each solution in vs2013 it's fine.
this nuget settings in each of *.sln file:
project("{2150e333-8fdc-42a3-9474-1a3956d46de8}") = ".nuget", ".nuget", "{334b5d1d-8694-472b-8170-3d36a395dcef}" projectsection(solutionitems) = preproject .nuget\packages.config = .nuget\packages.config endprojectsection endproject
what did wrong ? how can run nuget restore
console in case ?
try nuget restore solutionabc.sln
see https://docs.nuget.org/consume/command-line-reference
see bolded section below why error.
restore command notes
the restore command executed in following steps:
determine operation mode of restore command.
if packages.config file specified, nuget restores packages listed in packages.config file.
if solution specified, nuget restores packages solution's projects. in case, nuget needs locate solution file.
if solution file, file used solution file.
if solution directory, nuget searches *.sln file in directory. if 1 file found, file used solution file. otherwise, nuget displays error message , exits.
if no argument provided, nuget first looks solution files in current directory. if there 1 solution file, nuget restore packages solution. if there multiple solution files, error message displayed , nuget exits.
if there no solution files, nuget searches packages.config file in current directory. if file exists, nuget restore packages listed in packages.config file.
if there no solution files , no packages.config file in current directory, error message displayed , nuget exits.
if operation mode restoring solution, -solutiondirectory option not applicable. in case, nuget displays error message , exits.
Comments
Post a Comment