2
votes

I am trying to get a simple SpecFlow+ example up and running on Azure DevOps.

Currently I get the following Error Message:

SpecFlow+LivingDoc: An error happened during the execution: The SDK 'Microsoft.NET.Sdk' specified could not be found.

  1. How do I install the required "Microsoft .NET Test SDK 15"?
  2. Can somebody point me to a simple example SpecFlow setup for Azure DevOps?

All details can be found on this public Azure DevOps project: https://dev.azure.com/FlorianBoehmak/_git/SpecFlowCalculator


EDIT

Thanks @Levi Lu-MSFT for pointing me into the right direction. I put everything together into a github repository (including a devops generator). Enjoy :-)

https://github.com/fnbk/SpecFlowCalculator

enter image description here

1

1 Answers

2
votes

In the yaml pipeline definition, it seems that the vstest task didnot specify the test .dll file. You can try specifying the test dlls like below.

- task: VSTest@2
  inputs:
    testAssemblyVer2: |
      **\Calculator.Spec.dll
      !**\obj\**
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

And if your project is a .net core project, the Project file path field in the SpecFlow+ is the path containing your project, not the project itself. You can try setting the projectfilepath to you root directory of your source repo like below.check here

- task: SpecFlowPlus@0
  inputs:
    projectFilePath: '$(System.DefaultWorkingDirectory)'
    projectLanguage: 'en'

Hope above can be of some help!