Using Nuget in a prebuild step with demo apps

May 19, 2011 at 4:28 PM

We are trying to use nuget in a pre-build step with our sample application.  This is to make sure that anyone using out samples has the latest version of the code.

Is this possible to with the current implementation of nuget?  If not, does it make since to submit it as a feature request?

 

Thanks,
Steve Hatch
Dell.com

 

Coordinator
May 19, 2011 at 4:55 PM

What exactly would you want the pre-build step to do? We know some folks want to have pre-build steps that restore packages. But it sounds like you want the pre-build step to do an actual upgrade.

In many cases, this requires that the pre-build step would have to run in VS so it can correctly add files to the csproj, add assembly references, perform web.config transforms.

Is that what you’re thinking about?

May 19, 2011 at 5:32 PM

I think we were thinking of running the upgrade say against a ci feed.

sent from my mobile

On May 19, 2011 11:55 AM, "Haacked" <notifications@codeplex.com> wrote:
> From: Haacked
>
> What exactly would you want the pre-build step to do? We know some folks want to have pre-build steps thatrestore packages. But it sounds like you want the pre-build step to do an actual upgrade.In many cases, this requires that the pre-build step would have to run in VS so it can correctly add files to the csproj, add assembly references, perform web.config transforms.Is that what you’re thinking about?
>
>
Developer
May 19, 2011 at 6:00 PM

We never modify the project file from outside of VS, so updates won't ever really work until we supported something like that.

Coordinator
May 19, 2011 at 6:05 PM

The ability to have full NuGet support outside of VS is a longstanding feature request (see http://nuget.codeplex.com/workitem/818)

But as we point out in that issue, it’s a fairly significant amount of work.

At first glance, it seems simple. Just have NuGet.exe download and unpack new versions of each package in packages.config.

But in reality, it’s much trickier than that. For example, what happens when the newer version of the package has:

· New files which need to be properly added to the .csproj file.

· New assemblies which also need to be properly added to the .csproj file as assembly references.

· Web.config transforms

· Powershell scripts which need to run against the Visual Studio DTE

As you can see, that last one would be really tricky because your CI machine wouldn’t have a Visual Studio instance running. So packages like EntityFramework.SqlServerExpress which have Install.ps1 scripts that automate the DTE cannot be installed outside of Visual Studio.

May 19, 2011 at 7:57 PM

The main use case would be seperate teams pulling down down application (which they would rebuild on their local machine in vs2010).  We would like the demo projects to simply update themselves pre-build if there is newer content or code as part of the project.  With that being said, we can assume that vs2010 will be available.

If I'm understand you correctly it sounds like the functionallity is already there, are there any samples or demos of this available?

Thanks for your help,
Steve Hatch
Dell.com

Coordinator
May 19, 2011 at 10:13 PM

No, this functionality does not exist yet. In NuGet 1.4, we will have a command to update all packages in all projects. This sounds like what you want.

What I don’t think we have is a way to launch that command from a pre-build step. The command currently is run via our PowerShell Console: Update-Package

Please log a feature request for this and we’ll consider it as it’s a neat idea. J

May 19, 2011 at 10:20 PM

This sounds similar to what the new mvc 3 templates di, where they install packages durring creation.

sent from my mobile

On May 19, 2011 5:14 PM, "Haacked" <notifications@codeplex.com> wrote:
> From: Haacked
>
> No, this functionality does not exist yet. In NuGet 1.4, we will have a command to update all packages in all projects. This sounds like what you want.What I don’t think we have is a way to launch that command from a pre-build step. The command currently is run via our PowerShell Console:Update-PackagePlease log a feature request for this and we’ll consider it as it’s a neat idea.J
>
>
Coordinator
May 19, 2011 at 10:21 PM

That’s a little different. That’s a one-time install on project creation. However, the mechanism by which that happens might end up being similar. J