Reputation: 874
i have a problem,in Team Foundation Service i would read a version from Assembly Info that is auto increased when i run a build.... and set this version in nupsec file to create a nuget package with the same number, ex
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]
In tfs i can use power shell script but i don't know how to made this(i don't know power shell script). Can anyone help me or tell me a site when i find solution?? Thanks and sorry for my bad English.
Upvotes: 4
Views: 2150
Reputation: 874
Finally i solved my problem, i found on tfs marketplace task that reads assembly version and sets automatically its value to nuspec file, so the nuget package version is the same of assembly. To whom it may concern, the task name is:
Nuget version synchronizer published by Cdiscount Alm
Thanks anyway for your help, guys
Upvotes: 4
Reputation: 674
Looks like you've already versioned your build.
You can use the same number for your NuGet package versionig.
Edit your build process. Go to Options tab and set build number like $(date:yyyy.MM.dd)$(rev:.r) Then go to Tasks tab, press Add Task, Package, NuGet Packager.
Expand "Pack Options" for this step and set Automatic package versioning to "Use the build number".
It's the easiest way to version your NuGet (but not the best).
I would recommend to create a variable like "YourProjectName_BuildNumber" for NuGet package versioning. More details about variables: here.
More details about PowerShell in TFS: here.
Upvotes: 0