Triggering one project from another

Arnon's Avatar

Arnon

27 Mar, 2019 07:22 AM

Hi,
I have a project on GitHub that contain few C# projects with some dependencies among them. In addition, Some of these projects depend the old MSTest which was included up to 2015 and on Coded UI, also of VS2015. However, other projects are not specific to the version of Visual Studio and I want to convert them to .Net Standard. For that I want to move these projects to a new solution in Visual Studio 2017 and make the VS2015 specific projects reference the libraries that are produced by the VS2017 projects. This also means that I need 2 images for the AppVeyor build: one for VS2015 and one for VS2017. I thought of two possible solutions, but got stuck with both:
1. The first solution I thought of was to create 2 AppVeyor projects that use 2 different appveyor.yml files. However, I need the VS2015 build to start only after the VS2017 build has completed, and I also need to access the NuGet packages that the first project produces by the second one.
2. Create one AppVeyor project with 2 images, one of VS2015 and the other of VS2017. However I didn't see if its possible to communicate and to synchronize between the two.

Note: the csproj that uses MSTest V1 is not a mere unit tests project (which if it was I could simply upgrade it to MSTest V2 also), but rather a project that contain utilities for MSTest that I provide to my clients. I do also have another similar project (in the same repo and solution) for MSTest V2, but I keep the old one for backward compatibility and for clients that still use MSTest V1 themselves. For more info visit my repo: https://github.com/arnonax/TestEssentials/

Please advise how can I achieve my goal and build some projects in .Net Standard (VS2017) and others that consume them but also require VS2015 and MSTest V1.

Thanks in advance,
Arnon.

  1. Support Staff 1 Posted by Ilya Finkelshte... on 27 Mar, 2019 05:23 PM

    Ilya Finkelshteyn's Avatar

    Hi Arnon,

    I would suggest the following:

    • Leave a single solution, but create separate configurations, one containing old MSTest projects and another containing .NET Standard projects. Lets call those configurations OldMsTest and NetStandard for example.

    • Create a build build matrix which will run OldMsTest on Visual Studio 2015 and NetStandard on Visual Studio 2017. Simplest way to achieve this is used environment variables-based matrix, e.g.

    environment:
      matrix:
        - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
          CONFIGURATION: NetStandard
        - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
          CONFIGURATION: OldMsTest
    
    • Then you need to make Visual Studio 2015/OldMsTestjob to wait for the Visual Studio 2017/NetStandard one. We do not have 1st class support for dependencies between jobs, but you can use this script sample. just in this case you need to make 2nd job to wait, not 1st one.

    • I assume that Visual Studio 2017/NetStandard will package nuget artifacts and Visual Studio 2015/OldMsTest will get them from AppVeyor nuget feed. Note that AppVeyor push nuget packages to the feed asynchronously, so when Visual Studio 2017/NetStandard job finished, nuget packages can be still in the process of publishing. So there is a very small chance of race condition exist. If you hit it, you can simple add retry to nuget restore, e.g. appveyor-retry nuget restorein the configuration specific to Visual Studio 2015/OldMsTest.

    • To specialize build scenario for build jobs in matrix check this.

    Ilya.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac