@@ -34,13 +34,15 @@ public static void Main(string [] args)
34
34
}
35
35
}" ;
36
36
37
- [ WindowsOnlyFact ]
38
- public void Multiple_frameworks_are_written_to_runtimeconfig_when_there_are_multiple_FrameworkReferences ( )
37
+ [ WindowsOnlyTheory ]
38
+ [ InlineData ( "net6.0" , true ) ]
39
+ [ InlineData ( "netcoreapp3.1" , false ) ]
40
+ public void Multiple_frameworks_are_written_to_runtimeconfig_when_there_are_multiple_FrameworkReferences ( string targetFramework , bool shouldIncludeBaseFramework )
39
41
{
40
42
var testProject = new TestProject ( )
41
43
{
42
44
Name = "MultipleFrameworkReferenceTest" ,
43
- TargetFrameworks = "netcoreapp3.0" ,
45
+ TargetFrameworks = targetFramework ,
44
46
IsExe = true
45
47
} ;
46
48
@@ -49,7 +51,7 @@ public void Multiple_frameworks_are_written_to_runtimeconfig_when_there_are_mult
49
51
50
52
testProject . SourceFiles . Add ( "Program.cs" , FrameworkReferenceEmptyProgramSource ) ;
51
53
52
- var testAsset = _testAssetsManager . CreateTestProject ( testProject ) ;
54
+ var testAsset = _testAssetsManager . CreateTestProject ( testProject , identifier : targetFramework ) ;
53
55
54
56
var buildCommand = new BuildCommand ( testAsset ) ;
55
57
@@ -63,9 +65,14 @@ public void Multiple_frameworks_are_written_to_runtimeconfig_when_there_are_mult
63
65
string runtimeConfigFile = Path . Combine ( outputDirectory . FullName , testProject . Name + ".runtimeconfig.json" ) ;
64
66
var runtimeFrameworkNames = GetRuntimeFrameworks ( runtimeConfigFile ) ;
65
67
66
- // When we remove the workaround for https://github.com/dotnet/core-setup/issues/4947 in GenerateRuntimeConfigurationFiles,
67
- // Microsoft.NETCore.App will need to be added to this list
68
- runtimeFrameworkNames . Should ( ) . BeEquivalentTo ( "Microsoft.AspNetCore.App" , "Microsoft.WindowsDesktop.App" ) ;
68
+ if ( shouldIncludeBaseFramework )
69
+ {
70
+ runtimeFrameworkNames . Should ( ) . BeEquivalentTo ( "Microsoft.AspNetCore.App" , "Microsoft.WindowsDesktop.App" , "Microsoft.NETCore.App" ) ;
71
+ }
72
+ else
73
+ {
74
+ runtimeFrameworkNames . Should ( ) . BeEquivalentTo ( "Microsoft.AspNetCore.App" , "Microsoft.WindowsDesktop.App" ) ;
75
+ }
69
76
}
70
77
71
78
[ Theory ]
@@ -148,7 +155,7 @@ public void DuplicateFrameworksAreNotWrittenToRuntimeConfigWhenThereAreDifferent
148
155
var testProject = new TestProject ( )
149
156
{
150
157
Name = "MultipleProfileFrameworkReferenceTest" ,
151
- TargetFrameworks = "netcoreapp3 .0" ,
158
+ TargetFrameworks = "net6 .0" ,
152
159
IsExe = true
153
160
} ;
154
161
@@ -171,9 +178,7 @@ public void DuplicateFrameworksAreNotWrittenToRuntimeConfigWhenThereAreDifferent
171
178
string runtimeConfigFile = Path . Combine ( outputDirectory . FullName , testProject . Name + ".runtimeconfig.json" ) ;
172
179
var runtimeFrameworkNames = GetRuntimeFrameworks ( runtimeConfigFile ) ;
173
180
174
- // When we remove the workaround for https://github.com/dotnet/core-setup/issues/4947 in GenerateRuntimeConfigurationFiles,
175
- // Microsoft.NETCore.App will need to be added to this list
176
- runtimeFrameworkNames . Should ( ) . BeEquivalentTo ( "Microsoft.WindowsDesktop.App" ) ;
181
+ runtimeFrameworkNames . Should ( ) . BeEquivalentTo ( "Microsoft.WindowsDesktop.App" , "Microsoft.NETCore.App" ) ;
177
182
}
178
183
179
184
[ Fact ]
@@ -677,14 +682,14 @@ public void TransitiveFrameworkReferenceFromProjectReference()
677
682
var testProject = new TestProject ( )
678
683
{
679
684
Name = "TransitiveFrameworkReference" ,
680
- TargetFrameworks = "netcoreapp3 .0" ,
685
+ TargetFrameworks = "net6 .0" ,
681
686
IsExe = true
682
687
} ;
683
688
684
689
var referencedProject = new TestProject ( )
685
690
{
686
691
Name = "ReferencedProject" ,
687
- TargetFrameworks = "netcoreapp3 .0" ,
692
+ TargetFrameworks = "net6 .0" ,
688
693
} ;
689
694
690
695
referencedProject . FrameworkReferences . Add ( "Microsoft.ASPNETCORE.App" ) ;
@@ -707,7 +712,7 @@ public void TransitiveFrameworkReferenceFromProjectReference()
707
712
708
713
// When we remove the workaround for https://github.com/dotnet/core-setup/issues/4947 in GenerateRuntimeConfigurationFiles,
709
714
// Microsoft.NETCore.App will need to be added to this list
710
- runtimeFrameworkNames . Should ( ) . BeEquivalentTo ( "Microsoft.AspNetCore.App" ) ;
715
+ runtimeFrameworkNames . Should ( ) . BeEquivalentTo ( "Microsoft.AspNetCore.App" , "Microsoft.NETCore.App" ) ;
711
716
}
712
717
713
718
[ Fact ]
0 commit comments