Running tests on .NET 6, with Target Framework Moniker (TFM) not running

592
1
10-17-2023 02:36 AM
YuriiYanov
New Contributor II

Hello 

I am using ArcGis Pro 3.1 

Create the project for regression testing according to https://github.com/esri/arcgis-pro-sdk/wiki/ProGuide-Regression-Testing .It works when I am using target platform  net6.0-windows but when I am using  Target Framework Moniker <TargetFramework>net6.0-windows10.0.18362.0</TargetFramework> it is even not trying to run and do not have any log information to find the reason of the issue. it just not running:

In test output only this information:

Building Test Projects
Even though the 'Run Tests in Parallel' setting is turned off, tests in projects that reference runsettings file '...\protests.runsettings' will be executed in parallel because it specifies the value for 'MaxCpuCount' as '0'.
Even though the 'Run Tests in Parallel' setting is turned off, tests in projects that reference runsettings file '...UI.Tests\protests.runsettings' will be executed in parallel because it specifies the value for 'MaxCpuCount' as '0'.
========== Starting test run ==========
========== Test run finished: 0 Tests (0 Passed, 0 Failed, 0 Skipped) run in < 1 ms ==========

I need to use it in order to have access to windows runtime  https://github.com/MicrosoftDocs/windows-dev-docs/blob/docs/hub/apps/desktop/modernize/desktop-to-uw... from .Net6 

0 Kudos
1 Reply
YuriiYanov
New Contributor II

Found actually the solution:

While all project has configuration similar to next, the platform is AnyCpu

 

 

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

 

 

Test project should have

 

 

    <TargetFramework>net6.0-windows10.0.22621.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <Platforms>ARM32;AnyCPU</Platforms>
    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
      None
    </ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
    <EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
    <UseWindowsForms>true</UseWindowsForms>
    <UseWPF>true</UseWPF>
    <ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
    <IsTestProject>true</IsTestProject>
    <EnableNETAnalyzers>false</EnableNETAnalyzers>
    <OutputPath>bin\$(Configuration)</OutputPath>

 

 

The most important here is ARM32 ( do not know why but it works)

0 Kudos