Our team has just started working with Nuget packages, for now locally on a local server directory. The problem starts when several developers are working on the same project and both accidentally up their patch build to the same version and upon publishing it they override each other. What the best way to work with local nuget packages safely?
Asked
Active
Viewed 140 times
2 Answers
1
If you're using git you can use Nerdbank GitVersioning.
It uses your git history to calculate a unique version number from each commit, so builds from 2 different commits will always have different version numbers

rbennett485
- 1,907
- 15
- 24
0
I do not know if there are any third party tools to realize it. And from the perspective of nuget packages, you could create a new distinguishable guid for PackageVersion
. Make every nuget package unique for everyone. If your nuget project is new sdk format, you could try these:
<PropertyGroup>
<PackageId>Test</PackageId>
<Version>1.0.0</Version>
<!--let your staff add their first name here-->
<Employee_Name>perry</Employee_Name>
<!--show the time of the pack project-->
<Release_Time>$([System.DateTime]::Now.ToString('yyyyMMddHHmm'))</Release_Time>
<PackageVersion Condition="'$(PackageVersion)'==''">$(Version)</PackageVersion>
<PackageVersion Condition="'$(Employee_Name)' != ''">$(PackageVersion)-$(Employee_Name)</PackageVersion>
<PackageVersion Condition="'$(Release_Time)' !=''">$(PackageVersion)-$(Release_Time)</PackageVersion>
</PropertyGroup>
Note: Employee_Name
should be set with every employee's name and Release_Time
is set as pack time by default.
And it is the unique identification id and cannot be overwritten by each other.

Mr Qian
- 21,064
- 1
- 31
- 41