简体   繁体   中英

Nuget restore without VS with package content installation

I'm trying to configurate CI for my .Net project.

In CI script i'm use

nuget.exe restore mysolution.sln

But this command only download nuget packages in ./packages directory, not install content in projects.

In Visual Studio I can use

Update-Package -reinstall -Project YourProjectName

or

Update-Package -reinstall 

both of this command reinstall packages whith it's content, not only download. For example, the nuget package GDAL added file GdalConfiguration.cs in project after installation, but not after "nuget restore" command. Second example - package Microsoft.SqlServer.Types, that added folder SqlServerTypes in project.

How can I fully reinstall pckages whithout VS by script? How do you solve this problem?

Thanks for any help!

How can I fully reinstall pckages without VS by script? How do you solve this problem?

I am afraid that you can not reinstall the nuget packages without Visual Studio. That because all those reinstall command line have to be executed on the Package Manager Console window and we could not use the Package manager console powershell outside visual studio, because package manager console is providing is access to visual studio objects :

https://github.com/NuGet/Home/issues/1512

Those CI command line does not modify a project file or packages.config, that the reason why you use nuget restore , nuget install and nuget update , none of those command line modify the project file, check NuGet CLI reference for some more details:

在此处输入图片说明

Check my other thread for some helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM