{
RunTest(new TestSettings()
.WithRuntimeConfigCustomizer(runtimeConfig => runtimeConfig
- .WithTfm(Constants.Tfm.Net6)
+ .WithTfm("net6.0")
.WithFramework(MicrosoftNETCoreApp, "5.0.0"))
.WithWorkingDirectory(SharedState.DotNetCurrentHive.BinPath),
multiLevelLookup: true)
public const string Disable = "Disable";
}
- public static class Tfm
- {
- public const string RuntimeConfigPropertyName = "tfm";
- public const string Net6 = "net6.0";
- public const string Net7 = "net7.0";
- public const string Net8 = "net8.0";
- }
-
public static class FxVersion
{
public const string CommandLineArgument = "--fx-version";
if (_tfm is not null)
{
- runtimeOptions.Add(
- Constants.Tfm.RuntimeConfigPropertyName,
- _tfm);
+ runtimeOptions.Add("tfm", _tfm);
}
if (_properties.Count > 0)
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-
-namespace Microsoft.Extensions.Hosting.IntegrationTesting
-{
- public static class Tfm
- {
- public const string Net462 = "net462";
- public const string NetCoreApp20 = "netcoreapp2.0";
- public const string NetCoreApp21 = "netcoreapp2.1";
- public const string NetCoreApp22 = "netcoreapp2.2";
- public const string NetCoreApp30 = "netcoreapp3.0";
- public const string NetCoreApp31 = "netcoreapp3.1";
- public const string NetCoreApp50 = "net5.0";
-
- public static bool Matches(string tfm1, string tfm2)
- {
- return string.Equals(tfm1, tfm2, StringComparison.OrdinalIgnoreCase);
- }
- }
-}
private RuntimeFlavor GetRuntimeFlavor(string tfm)
{
- if (Tfm.Matches(Tfm.Net462, tfm))
+ if (tfm.ToLowerInvariant() == "net462")
{
return RuntimeFlavor.Clr;
}
{
// Core+Standalone always publishes. This must be Clr+Standalone or Core+Portable.
// Run from the pre-built bin/{config}/{tfm} directory.
+ Version version = Environment.Version;
var targetFramework = DeploymentParameters.TargetFramework
- ?? (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? Tfm.Net462 : Tfm.NetCoreApp22);
+ ?? (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? "net462" : $"net{version.Major}.{version.Minor}");
workingDirectory = Path.Combine(DeploymentParameters.ApplicationPath, "bin", DeploymentParameters.Configuration, targetFramework);
// CurrentDirectory will point to bin/{config}/{tfm}, but the config and static files aren't copied, point to the app base instead.
DeploymentParameters.EnvironmentVariables["DOTNET_CONTENTROOT"] = DeploymentParameters.ApplicationPath;
var applicationPath = string.Empty; // disabled for now
#pragma warning restore 0618
+ Version version = Environment.Version;
var deploymentParameters = new DeploymentParameters(
applicationPath,
RuntimeFlavor.CoreClr,
RuntimeArchitecture.x64)
{
- TargetFramework = Tfm.NetCoreApp50,
+ TargetFramework = $"Environment{version.Major}.{version.Minor}",
ApplicationType = ApplicationType.Portable,
PublishApplicationBeforeDeployment = true,
StatusMessagesEnabled = false