Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
<_AndroidFastDeploymentSupported Condition=" Exists ('$(MSBuildThisFileDirectory)../tools/Xamarin.Android.Common.Debugging.targets') ">true</_AndroidFastDeploymentSupported>
<_AndroidFastDeploymentSupported Condition=" '$(_AndroidFastDeploymentSupported)' == '' ">False</_AndroidFastDeploymentSupported>

<!-- TODO: remove when we have debugger support for CoreCLR -->
<UseMonoRuntime Condition=" '$(UseMonoRuntime)' == '' and '$(Configuration)' == 'Debug' ">true</UseMonoRuntime>

<!--
Disable @(Content) from referenced projects
See: https://github.com/dotnet/sdk/blob/955c0fc7b06e2fa34bacd076ed39f61e4fb61716/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets#L16
Expand Down
18 changes: 15 additions & 3 deletions tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2233,7 +2233,9 @@ public void StartAndroidActivityRespectsAndroidDeviceUserId ()
}

[Test]
public void DotNetNewAndroidTest ()
[TestCase (AndroidRuntime.MonoVM)]
[TestCase (AndroidRuntime.CoreCLR)]
public void DotNetNewAndroidTest (AndroidRuntime runtime)
{
var templateName = TestName;
var projectDirectory = Path.Combine (Root, "temp", templateName);
Expand All @@ -2244,12 +2246,22 @@ public void DotNetNewAndroidTest ()
var dotnet = new DotNetCLI (Path.Combine (projectDirectory, $"{templateName}.csproj"));
Assert.IsTrue (dotnet.New ("androidtest"), "`dotnet new androidtest` should succeed");

bool useMonoRuntime = runtime == AndroidRuntime.MonoVM;
var buildParameters = new List<string> {
$"UseMonoRuntime={useMonoRuntime}",
};

if (runtime == AndroidRuntime.CoreCLR) {
Assert.Ignore ("https://github.com/dotnet/android/issues/11174");
}
Comment on lines +2249 to +2256
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, the CoreCLR test fails:

Image

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

@simonrozsival simonrozsival Apr 22, 2026

Choose a reason for hiding this comment

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

the PR that will fix this looks solid: microsoft/testfx#7772


// Build and assert 0 warnings
Assert.IsTrue (dotnet.Build (), "`dotnet build` should succeed");
Assert.IsTrue (dotnet.Build (parameters: buildParameters.ToArray ()), "`dotnet build` should succeed");
dotnet.AssertHasNoWarnings ();

// Run instrumentation via `dotnet run` and capture output
using var process = dotnet.StartRun (waitForExit: true);
var runParameters = buildParameters.Select (p => $"/p:{p}").ToArray ();
using var process = dotnet.StartRun (waitForExit: true, parameters: runParameters);

var locker = new Lock ();
var output = new StringBuilder ();
Expand Down