Skip to content

Commit a85fb2b

Browse files
committed
Add test
1 parent 84f1769 commit a85fb2b

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System;
5+
using Xunit;
6+
7+
public unsafe class ExternalAssemblyProbe
8+
{
9+
[Fact]
10+
public static void ExternalAppAssemblies()
11+
{
12+
// In order to get to this point, the runtime must have been able to find the app assemblies
13+
// Check that the TPA is indeed empty - that is, the runtime is not relying on that property.
14+
string tpa = AppContext.GetData("TRUSTED_PLATFORM_ASSEMBLIES") as string;
15+
Assert.True(string.IsNullOrEmpty(tpa), "TRUSTED_PLATFORM_ASSEMBLIES should be empty");
16+
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<!-- Needed for CLRTestEnvironmentVariable -->
4+
<RequiresProcessIsolation>true</RequiresProcessIsolation>
5+
<NativeAotIncompatible>true</NativeAotIncompatible>
6+
<!-- External assembly probe via host-runtime contract is not implemented.
7+
The test uses probing to start at all, so it needs to be disabled in the project, not via an attribute -->
8+
<CLRTestTargetUnsupported Condition="'$(RuntimeFlavor)' != 'coreclr'">true</CLRTestTargetUnsupported>
9+
</PropertyGroup>
10+
<ItemGroup>
11+
<Compile Include="ExternalAssemblyProbe.cs" />
12+
13+
<CLRTestEnvironmentVariable Include="APP_ASSEMBLIES" Value="EXTERNAL" />
14+
</ItemGroup>
15+
</Project>

0 commit comments

Comments
 (0)