Cannot run DataRow tests with array Type arguments under Native AOT

クローズ
#11,994 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

関連するプルリクエストがすでにマージされています。

  • #11999 @Sergio0694 による — マージ済み

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp
領域
testing

調査の方向性

Start with the attached MSTestArrayRepro.zip project and publish it for Native AOT as described, then compare the results with CoreCLR. Focus on how the array Type argument in DataRow is passed when another test uses a single-argument DataRow. Done means both ArrayTypeRows cases run successfully under Native AOT.

索引モデルが issue の本文から書いたものです。

説明

area/native-aot area/parameterized-tests needs/triage type/regression

Describe the bug

A test method containing an array  Type  argument in a  [DataRow]  fails under Native AOT when another test uses a single-argument  [DataRow] .

Repro attached, test passes on CoreCLR but fails under Native AOT.

Version used

  • MSTest / MSTest.Sdk: 4.5.1
  • Microsoft.Testing.Platform: 2.5.1
  • .NET SDK: 10.0.402
  • .NET runtime / Native AOT compiler: 10.0.13
  • Windows x64

Steps To Reproduce

Publish and run below repro project for AOT.

MSTestArrayRepro.zip

Expected behavior

All tests pass

Actual behavior

MSTest v4.5.1 (UTC 2026-10-07)
failed ArrayTypeRows ([System.Int32,"Int32","kind"]) (2ms)
  Cannot run test method 'Repro.ArrayTests.ArrayTypeRows': Test data doesn't match method parameters. Either the count or types are different.
  Test expected 3 parameter(s), with types 'Type, String, String',
  but received 1 argument(s), with types 'Object[]'.
    at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions.MethodInfoExtensions.GetInvokeResultWithParametersAsync(MethodInfo, Object, ParameterInfo[], Object[]) + 0x4a5
    at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestMethodInfo.<ExecuteInternalAsync>d__63.MoveNext() + 0x2c4
failed ArrayTypeRows ([System.Int32[],"Int32[]","kind"]) (0ms)
  Cannot run test method 'Repro.ArrayTests.ArrayTypeRows': Test data doesn't match method parameters. Either the count or types are different.
  Test expected 3 parameter(s), with types 'Type, String, String',
  but received 1 argument(s), with types 'Object[]'.
    at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions.MethodInfoExtensions.GetInvokeResultWithParametersAsync(MethodInfo, Object, ParameterInfo[], Object[]) + 0x4a5
    at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestMethodInfo.<ExecuteInternalAsync>d__63.MoveNext() + 0x2c4

Additional context

主要言語
C#
スター
1.1k
フォーク
312
平均マージ
11時間 6分
マージ済み PR(30日)
326

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/testfx のほかの issue

microsoft/testfx の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。