Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 6, 2025

The MTP (Microsoft Testing Platform) runner in Arcade was incorrectly handling .dll files for non-Core (.NET Framework) workloads by executing them directly via shell execute. This could lead to unintended behavior, such as opening the .dll with associated programs (like ILSpy) instead of running tests.

Problem

When TestRuntime is not 'Core', the _TestRunner property was set to $(_TestAssembly) (line 31 in Microsoft.Testing.Platform.targets). If the assembly was a .dll file, it would be executed directly, causing the system to launch whatever program is associated with .dll files.

Solution

Added validation to check that non-Core workloads use executable (.exe) files instead of .dll files:

<!-- Validate that non-Core workloads use executable files, not DLL files -->
<Error Condition="'$(_TestRuntime)' != 'Core' and !$(_TestAssembly.EndsWith('.exe', StringComparison.OrdinalIgnoreCase))" 
       Text="MTP runner for non-Core workloads requires an executable (.exe) file, but was given: '$(_TestAssembly)'. Please set &lt;OutputType&gt;Exe&lt;/OutputType&gt; in your project file." />

Features

  • Clear error message: Provides actionable guidance to set <OutputType>Exe</OutputType> in the project file
  • Case-insensitive: Accepts both .exe and .EXE extensions
  • Non-breaking: Only affects non-Core workloads; Core workloads continue to work with .dll files as expected

Testing

Verified the fix with multiple test scenarios:

  • ✅ .dll files for non-Core workloads produce clear error message
  • ✅ .exe files (both .exe and .EXE) for non-Core workloads pass validation
  • ✅ .dll files for Core workloads continue to work (not affected)

Fixes #15884.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] MTP runner in arcade should report error when given dll for non-core workloads Fix MTP runner to report error when given .dll for non-Core workloads Jun 6, 2025
@Copilot Copilot AI requested a review from nohwnd June 6, 2025 12:21
Copilot finished work on behalf of nohwnd June 6, 2025 12:21
@nohwnd
Copy link
Member

nohwnd commented Jun 6, 2025

@copilot LGTM, publish it.

Copy link
Member

@Youssef1313 Youssef1313 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. There is a small follow-up I'd like to do but I'm afraid to write here and Copilot tries to pick it up and tries to do the change in this PR 😄

Edit: #15884 (comment)

Copilot finished work on behalf of nohwnd June 6, 2025 13:26
Copilot finished work on behalf of Youssef1313 June 6, 2025 13:27
@nohwnd nohwnd marked this pull request as ready for review June 6, 2025 13:31
@nohwnd nohwnd merged commit 4fb1100 into main Jun 10, 2025
12 checks passed
@nohwnd nohwnd deleted the copilot/fix-15884 branch June 10, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MTP runner in arcade should report error when given dll for non-core workloads

3 participants