0

I have a nuget spec that installs both library file (dll) and two zip packages on a specific folder. Updating the packages is no issue when doing it from Visual Studio 2013 manually. However, when it is being triggered from either our CI servers TeamCity and CCNet, it is only updating the dll file and not the two zip packages which is vital.

I assume that since there are previous zip files existing on the folders, it may be having difficulty overwriting the files, since, in VS2013, a prompt confirms if the user wants to overwrite those files.

When I use the Package Manager Console from VS2013, I can easily trigger Update-Package –reinstall [Package Id] and it'll do the job correctly. Now, I need to do the same thing and apply some automation from our CI server.

If I understand it correctly, I can trigger nuget commands from powershell?

I would greatly appreciate your inputs, I'm not an expert in this.

3
  • You can call any exe files from Powershell scripts, so in case your nuget provides an exe to trigger its commands, yes you can. About overwriting those zip files, you can do Copy-Item $source $destination -force this will simulate a yes for the overwrite prompt. It's quite possible that your CI servers also have an option for force overwrite files during a command, so just seek their manuals. Commented Jun 15, 2015 at 7:11
  • Hi Vesper, thanks for the inputs. How exactly can I call the nuget from powershell? Commented Jun 15, 2015 at 7:24
  • I think you should install nuget command line and use those commands as exe calls. I'm not sure though how to call command line in context of a project, but you might find something useful from referenced data. And, there is a FileConflictAction you can set to overwrite to rebuild your zip files. Commented Jun 15, 2015 at 7:35

1 Answer 1

1

You should run the update command from nuget.exe. One of the parameters of the update command is FileConflictAction, which tells what action to take when asked to overwrite or ignore existing files referenced by the project: overwrite, Ignore, None.

You might have to wrap everything in a powershell script, possibly referring to EnvDTE, to set your paths and to mimick the environment you have from the PowerShell console within Visual Studio.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.