title: Specify framework/platform in Azure pipeline yml
body: <p>I want to tell Azure to run tests against the framework and platform actually used by my test project. According to <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/vstest?view=azure-devops#q--a" rel="nofollow noreferrer">Microsoft</a>, </p>
  
  <blockquote>
    <p>Tests that target the .NET core framework can be executed by specifying the appropriate target framework value.</p>
  </blockquote>
  
  <p>But how do I do that? </p>
  
  <p>Additionally, the log output says there is an issue of different platforms. I'm not sure how to address that either. I've tried putting a platform into my yml, but it doesn't help.</p>
  
  <p>Here is my current yml:</p>
  
  <pre><code>- job: Test
    dependsOn: SetBuildName
  
    pool:
      vmImage: 'windows-2019'
  
    variables:
      solution: '**/MyTestSolution.sln'
      buildPlatform: 'x86|x64|ARM'
      buildConfiguration: 'Release'
      appxStagingDir: '$(build.artifactStagingDirectory)\AppxPackages\\'
  
    steps:
    - task: NuGetToolInstaller@1
      inputs:
        versionSpec: '5.4.0'
    - task: NuGetCommand@2
      inputs:
        restoreSolution: '$(solution)'    
  
    - task: VersionAPPX@2
      inputs:
        Path: '$(Build.SourcesDirectory)'
        VersionNumber: '$(versionNumber)'
        InjectVersion: true
        OutputVersion: 'OutputedVersion'  
  
    - task: VSBuild@1
      inputs:
        platform: 'x86'   #Changing this to AnyCPU had no effect.
        solution: '$(solution)'
        configuration: '$(buildConfiguration)'
        msbuildArgs: '/t:Restore'
  
    - task: VSBuild@1
      inputs:
        platform: 'x86'
        solution: '$(solution)'
        configuration: '$(buildConfiguration)'
        msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)"
                      /p:AppxPackageDir="$(appxStagingDir)"
                      /p:AppxBundle=Always
                      /p:UapAppxPackageBuildMode=Sideload
                      /p:AppxPackageSigningEnabled=true
                      /p:VersionPrefix="$(versionNumber)"
                      /p:VersionSuffix="$(version.SpecialBuild)"
                      /p:SourceRevisionId="$(Build.SourceVersion)"'
  </code></pre>
  
  <p>And here is an excerpt from the log:</p>
  
  <pre><code>2020-03-19T12:28:57.5842598Z Test run will use DLL(s) built for framework .NETFramework,Version=v4.0 and platform X86. Following DLL(s) do not match framework/platform settings.
  2020-03-19T12:28:57.5843802Z MyProject.Test.dll is built for Framework .NETCoreApp,Version=v3.1 and Platform AnyCPU.
  </code></pre>
  
  <p>The best solution would be to tell it to use whatever the project built against. But if that isn't possible, I'd settle for a way to specify NETCoreApp 3.1 and AnyCPU.</p>