0

The following works on my pc, but when I move to DEVOPs, it errors out.

I have Micrsosoft.Expression.Encoder Installed via nuget. It installs with the nuget installer step on DEVOPS.

The first step of my tests has the following

this.Scj = new ScreenCaptureJob();

and I get the following error:

object reference not set to an instance of an object.

I have the following settings set up in runsettings.

<DataCollectionRunSettings>
<DataCollectors>
      <DataCollector uri="datacollector://microsoft/VideoRecorder/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorder.VideoRecorderDataCollector, Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorder, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="Screen and Voice Recorder">
    <!--Video data collector was introduced in Visual Studio 2017 version 15.5 -->
  </DataCollector>
</DataCollectors>

Is there any other settings in DEVOPS that is needed to run these tests? I have run this on 2017 and 2019 locally. I have the settings as 'Latest', in DEVOPs.

Greg P
  • 772
  • 2
  • 10
  • 23
  • Can you post the stack trace with the error message? – Greg Burghardt Aug 16 '19 at 14:01
  • I am new to DEVOPS and trying to figure out where all that stuff resides....but the thing I remember is not just loading the nuget package was enough, I had to install the software on my pc (and our previous server)....so, we are not specifically pointing to a server to run these tests...so is there some sort of pool or something that I have to install or point to this software? I am waiting for our admin to come in, because he may know more about this as well..but any help is appreciated. – Greg P Aug 16 '19 at 14:03
  • Did you have nuget retore step in your pipeline definition. If the dependency package is added to your project references. nuget restore step will install all the packages in the PackageReference of your project settings or package.config. BTW, you can find the build log in the Summary tab of your completed build runs, You can just click on the failed jobs to review the log, or click the ellipsis on the top right corner to download the full logs. – Levi Lu-MSFT Aug 19 '19 at 03:22
  • Yes, nuget restore is there, and the microsoft encoder exists....I am thinking because the standard agent pools that have the 99% of what I need is there, and the microsoft.expression.encoder is not...so either we have to just do screen prints using the pre-existing agent pools, or have to have one we build with our own specifications. – Greg P Aug 19 '19 at 13:23

1 Answers1

0

If microsoft.expression.encoder is missing in the standard agents. You can add a powershell task and run below scripts to download and install encoder on those agents.

To download encoder.exe

$client = new-object System.Net.WebClient
$link = "https://download.microsoft.com/download/E/3/4/E3423C3F-D17F-43E3-BB06-BC51245F573A/Encoder_en.exe"
$client.DownloadFile($link, "$(Agent.BuildDirectory)/Encoder_en.exe")

To install encode_en.exe

Start-Process "$(Agent.BuildDirectory)/Encoder_en.exe"  -ArgumentList '/S','/v','/qn' -passthru

Powershell tasks shown as below pic: enter image description here

Levi Lu-MSFT
  • 27,483
  • 2
  • 31
  • 43