0

I don't include Bootstrap files into the source code.

When I restore all the package in the solution, bootstrap gets download into the package folder but it doesn't get moved to the Content/Font/Scripts folder in the Solution. Any reason nuget restore in Visual studio doesn't move the files into the right folders.

When I install it, it works fine.

Valter
  • 2,859
  • 5
  • 30
  • 51

1 Answers1

1

Nuget JS files not getting restore

That because NuGet Restore only restores files to the packages directory (\packages folder ), but does not restore files inside your project or otherwise modify your project.

You need use the NuGet command line in the Package Manager Console:

Update-Package -Id <package_name> –reinstall 

to force reinstall the package references or add JS file into project.

You can refer to the similar issue here and the document for more detail info.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • That kinda stinks... I was hoping there was some automatic way, so I and the other developers would have to do anything, since part of the build, the nuget restore command gets execute.| – Valter Sep 22 '17 at 13:47
  • @Valter, I understand your request. But if you want to automate that, you have to do this operations via NuGet CLI. Since Install package on NuGet CLI will not modify the reference of project, so we could not automate the operation install package to update the reference of the project. https://stackoverflow.com/questions/45684692/nuget-command-line-options-for-uninstalling-reinstalling-packages-for-tfs-vs2013/45728167#45728167. – Leo Liu Sep 22 '17 at 15:54
  • As a workaround for this issue, you can add this package to the project, then check those .js files with project into source code, otherwise, you need reinstall it with above command line. – Leo Liu Sep 22 '17 at 16:14