Unable to install package. Lock file has not changed, Skipping lock file write

Viewed 3087

I am trying to install System.ComponentModel.Annotations through VS 2017 package manager console.

Command:

Install-Package System.ComponentModel.Annotations -Version 4.3.0

Outcome

Restoring packages for C:\MyTest.csproj... Installing NuGet package System.ComponentModel.Annotations 4.3.0. Committing restore... Writing lock file to disk. Path: C:\MyTest\obj\project.assets.json Restore completed in 816.43 ms for C:\MyTest.csproj. Restoring packages for C:\MyTest.csproj... Committing restore... Lock file has not changed. Skipping lock file write. Path: C:\MyTest\obj\project.assets.json Restore completed in 2.03 sec for C:\MyTest.csproj. Executing nuget actions took 4.12 sec Time Elapsed: 00:00:05.2258592

Note:

I am using .NETCoreApp1.1 framework.

2 Answers

One should also check if there is a Directory.Build.targets file in some parent directory of the project that defines the version of the package. If this is the case (I had this problem), VS will ignore the version you install and will keep the version defined in the file, so you have to update the version there.

Related