0

first of all, excuse me for my English.

In VSTS (visual studio team services), I want to activate automatic compilation for my application. Before I bought the services, I wanted to know if my case would work.

I have a project A that has a dependency on project B. Project B will create a NuGet package each time a commit to master is uploaded.

I want you to commit a master commit on project A, VSTS build the project, but before that upgrade the NuGet package dependency from project B to the latest version.

Would that be possible? Or do I have to do Project Committee b, update the reference in Project A, and then upload Project A?

Thank you very much.

Meldrel
  • 155
  • 1
  • 2
  • 9

2 Answers2

3

If you are using Visual Studio 2017, check out the PackageReference tag in your project. You use this directly within your project, not a separate packages.config file.

https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files

You can use a Floating reference that will trigger the latest version automatically being consumed, e.g.

<ItemGroup>
    <PackageReference Include="Contoso.Utility.UsefulStuff" Version="3.6.*" />
</ItemGroup>
raterus
  • 1,980
  • 20
  • 23
  • We are using VS2015, but upgrade to 2017 is possible. Looks like it's working, although we want to run more tests. Thank you very much. – Meldrel Jan 31 '18 at 15:40
1

The simple way is that you can call nuget update command to update the packages to the latest version before Visual Studio Build task in the build.

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53