Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,9 @@
<!-- TODO: Remove when Arcade updated NetCurrent to net10.0. -->
<NetCurrent>net10.0</NetCurrent>
<NetToolMinimum Condition="'$(DotNetBuildSourceOnly)' == 'true'">$(NetCurrent)</NetToolMinimum>
<ToolsetTargetFramework>$(SdkTargetFramework)</ToolsetTargetFramework>
<VisualStudioServiceTargetFramework>net9.0</VisualStudioServiceTargetFramework>
<VisualStudioTargetFramework>net472</VisualStudioTargetFramework>

<!-- We used to have scenarios where the MSBuild host (VSMac) had an older .NET, but don't any more. -->
<ResolverTargetFramework>$(SdkTargetFramework)</ResolverTargetFramework>

<!-- NU1701 Disable implicit package target fallback, and disable warning for when we explicitly add it (currently needed for
Microsoft.ApplicationInsights) -->
<!-- NU1507 Disable multi-feed check as .NET uses multiple internal feeds intentionally -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(ResolverTargetFramework);net472</TargetFrameworks>
<TargetFrameworks>$(SdkTargetFramework);net472</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>
<SignAssembly>true</SignAssembly>
Expand Down
2 changes: 1 addition & 1 deletion src/Cli/Microsoft.DotNet.Cli.Utils/Polyfills.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#if NET472
#if NETFRAMEWORK

#pragma warning disable IDE0130 // Namespace does not match folder structure
namespace System.Runtime.CompilerServices {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" ExcludeAssets="runtime" />
</ItemGroup>

<!-- net472 builds manually import files to compile -->
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<!-- .NET Framework builds manually import files to compile -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<Compile Remove="**/*.*" />
<Compile Include="ReferenceParser.cs" />
<Compile Include="KnownStrings.cs" />
Expand All @@ -77,17 +77,17 @@
<Compile Include="Tasks/CreateNewImageToolTask.cs" />
<Compile Include="Tasks/ComputeDotnetBaseImageAndTag.cs" />
<Compile Include="ContainerHelpers.cs" />
<Compile Include="net472Definitions.cs" />
<Compile Include="netframeworkDefinitions.cs" />
<Compile Include="Port.cs" />
<Compile Include="Resources\Resource.cs" />
<Compile Include="Resources\Strings.Designer.cs" />
<Compile Include="Globals.cs" />
</ItemGroup>

<!-- core remove files specific to net472 workarounds -->
<ItemGroup Condition="'$(TargetFramework)' != 'net472'">
<!-- Non-.NET Framework builds remove files specific to .NET Framework workarounds -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">
<Compile Remove="Tasks/CreateNewImageToolTask.cs" />
<Compile Remove="net472Definitions.cs" />
<Compile Remove="netframeworkDefinitions.cs" />
</ItemGroup>
<ItemGroup>
<Compile Update="Resources\Strings.Designer.cs">
Expand Down
2 changes: 1 addition & 1 deletion src/Layout/redist/targets/Crossgen.targets
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<RemainingFiles Remove="$(InstallerOutputDirectory)Sdks\**\*" />
<RemainingFiles Remove="$(InstallerOutputDirectory)**\Microsoft.TestPlatform.Extensions.EventLogCollector.dll" />

<!-- Removing Containers as containerize .DLLs and net472 components shouldn't be crossgenned. -->
<!-- Removing Containers as containerize .DLLs and netframework components shouldn't be crossgenned. -->
Comment thread
marcpopMSFT marked this conversation as resolved.
<RemainingFiles Remove="$(InstallerOutputDirectory)Containers\**\*" />

<!-- Add back the .NET Core assemblies in the Sdks folder -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(ResolverTargetFramework);net472</TargetFrameworks>
<TargetFrameworks>$(SdkTargetFramework);net472</TargetFrameworks>
<!-- For product build, the .NET Framework TFM only builds in the second build pass as it depends on assets from other
verticals that are built in the first build pass. -->
<TargetFrameworks Condition="'$(DotNetBuild)' == 'true' and '$(DotNetBuildPass)' != '2'">$(ResolverTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(DotNetBuild)' == 'true' and '$(DotNetBuildPass)' != '2'">$(SdkTargetFramework)</TargetFrameworks>
<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>
<!-- Create FileDefinitions items for ResolveHostfxrCopyLocalContent target -->
<EmitLegacyAssetsFileItems>true</EmitLegacyAssetsFileItems>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(ResolverTargetFramework);net472</TargetFrameworks>
<TargetFrameworks>$(SdkTargetFramework);net472</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(ResolverTargetFramework);net472</TargetFrameworks>
<TargetFrameworks>$(SdkTargetFramework);net472</TargetFrameworks>
<!-- For product build, the .NET Framework TFM only builds in the second build pass as it depends on assets from other
verticals that are built in the first build pass. -->
<TargetFrameworks Condition="'$(DotNetBuild)' == 'true' and '$(DotNetBuildPass)' != '2'">$(ResolverTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(DotNetBuild)' == 'true' and '$(DotNetBuildPass)' != '2'">$(SdkTargetFramework)</TargetFrameworks>
<!-- Create FileDefinitions items for ResolveHostfxrCopyLocalContent target -->
<EmitLegacyAssetsFileItems>true</EmitLegacyAssetsFileItems>
<RootNamespace>Microsoft.DotNet.DotNetSdkResolver</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(ResolverTargetFramework)</TargetFrameworks>
<TargetFrameworks>$(SdkTargetFramework)</TargetFrameworks>
<IsPackable>true</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(ResolverTargetFramework);net472</TargetFrameworks>
<TargetFrameworks>$(SdkTargetFramework);net472</TargetFrameworks>
<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>
<IsPackable>true</IsPackable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/StaticWebAssetsSdk/Tasks/Data/StaticWebAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ public void Normalize()
// * Appends a trailing directory separator at the end.
public static string NormalizeContentRootPath(string path)
=> Path.GetFullPath(path) +
// We need to do .ToString because there is no EndsWith overload for chars in .net472
// We need to do .ToString because there is no EndsWith overload for chars in .NET Framework
(path.EndsWith(Path.DirectorySeparatorChar.ToString()), path.EndsWith(Path.AltDirectorySeparatorChar.ToString())) switch
{
(true, _) => "",
Expand Down
4 changes: 2 additions & 2 deletions src/StaticWebAssetsSdk/Tasks/Data/StaticWebAssetEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public bool Equals(StaticWebAssetEndpoint other) => other is not null && Route =

public override int GetHashCode()
{
#if NET472_OR_GREATER
#if NETFRAMEWORK
var hashCode = -604019124;
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Route);
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(AssetFile);
Expand Down Expand Up @@ -403,7 +403,7 @@ public bool Equals(StaticWebAssetEndpoint x, StaticWebAssetEndpoint y)

public int GetHashCode(StaticWebAssetEndpoint obj)
{
#if NET472_OR_GREATER
#if NETFRAMEWORK
var hashCode = -604019124;
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(obj.Route);
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(obj.AssetFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public bool Equals(StaticWebAssetEndpointProperty other) =>

public override int GetHashCode()
{
#if NET472_OR_GREATER
#if NETFRAMEWORK
var hashCode = -244751520;
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Name);
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public bool Equals(StaticWebAssetEndpointResponseHeader other) => string.Equals(

public override int GetHashCode()
{
#if NET472_OR_GREATER
#if NETFRAMEWORK
var hashCode = -244751520;
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Name);
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Value);
Expand Down
32 changes: 16 additions & 16 deletions src/WebSdk/Publish/Tasks/MsDeploy/CommonUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public static StringBuilder CleanStringBuilder
}
}

#if NET472
#if NETFRAMEWORK
/// <summary>
/// Return the current machine's IIS version
/// </summary>
Expand Down Expand Up @@ -440,7 +440,7 @@ public static bool CheckMSDeploymentVersion(Utilities.TaskLoggingHelper log, out
/// <param name="document"></param>
public static void SaveDocument(XmlDocument document, string outputFileName, Encoding encode)
{
#if NET472
#if NETFRAMEWORK
XmlTextWriter textWriter = new(outputFileName, encode)
{
Formatting = Formatting.Indented
Expand Down Expand Up @@ -487,7 +487,7 @@ private static bool CheckMSDeploymentVersion()
currentMinVersion = new Version(7, 1, 614); // current drop
{
string strMinimumVersion = string.Empty;
#if NET472
#if NETFRAMEWORK
using (Win32.RegistryKey registryKeyVs = Win32.Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\VisualStudio\11.0\WebDeploy"))
{
if (registryKeyVs != null)
Expand Down Expand Up @@ -544,7 +544,7 @@ private static bool CheckMSDeploymentVersion()
}
else
{
#if NET472
#if NETFRAMEWORK
_strErrorMessage = string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_MSDEPLOYLOADFAIL,
Resources.VSMSDEPLOY_MSDEPLOY32bit,
Resources.VSMSDEPLOY_MSDEPLOY64bit,
Expand All @@ -561,7 +561,7 @@ private static bool CheckMSDeploymentVersion()
}
}

#if NET472
#if NETFRAMEWORK
/// <summary>
/// Return a search path for the data
/// </summary>
Expand Down Expand Up @@ -605,7 +605,7 @@ internal static void BuildArgumentsBaseOnEnumTypeName(Framework.ITaskItem item,
if (!string.IsNullOrEmpty(data))
{
string valueData = PutValueInQuote(data, valueQuote);
#if NET472
#if NETFRAMEWORK
arguments.Add(string.Concat(enumName.ToLower(CultureInfo.InvariantCulture), "=", valueData));
#else
arguments.Add(string.Concat(enumName.ToLower(), "=", valueData));
Expand Down Expand Up @@ -684,7 +684,7 @@ public static void MsDeployExeEndOfExecuteMessage(bool bSuccess, string destType
string[] ArchiveDirOnly = new string[] { MSDeploy.Provider.ArchiveDir };
if (bSuccess)
{
#if NET472
#if NETFRAMEWORK
if (IsOneOf(destType, packageArchivedir, StringComparison.InvariantCultureIgnoreCase))
#else
if (IsOneOf(destType, packageArchivedir, StringComparison.OrdinalIgnoreCase))
Expand All @@ -695,7 +695,7 @@ public static void MsDeployExeEndOfExecuteMessage(bool bSuccess, string destType

string dir = Path.GetDirectoryName(destRoot) ?? string.Empty;
string dirUri = ConvertAbsPhysicalPathToAbsUriPath(dir);
#if NET472
#if NETFRAMEWORK
if (IsOneOf(destType, ArchiveDirOnly, StringComparison.InvariantCultureIgnoreCase))
#else
if (IsOneOf(destType, ArchiveDirOnly, StringComparison.OrdinalIgnoreCase))
Expand All @@ -712,7 +712,7 @@ public static void MsDeployExeEndOfExecuteMessage(bool bSuccess, string destType
}
else
{
#if NET472
#if NETFRAMEWORK
if (IsOneOf(destType, packageArchivedir, StringComparison.InvariantCultureIgnoreCase))
#else
if (IsOneOf(destType, packageArchivedir, StringComparison.OrdinalIgnoreCase))
Expand Down Expand Up @@ -745,7 +745,7 @@ public static void MsDeployEndOfExecuteMessage(bool bSuccess, string destType, s
// Deployment.DeploymentWellKnownProvider wellKnownProvider = Deployment.DeploymentWellKnownProvider.Unknown;
Type? DeploymentWellKnownProviderType = MSWebDeploymentAssembly.DynamicAssembly?.GetType(MSDeploy.TypeName.DeploymentWellKnownProvider);
dynamic? wellKnownProvider = MSWebDeploymentAssembly.DynamicAssembly?.GetEnumValue(MSDeploy.TypeName.DeploymentWellKnownProvider, "Unknown");
#if NET472
#if NETFRAMEWORK
if (string.Compare(destType, MSDeploy.Provider.DbDacFx, StringComparison.InvariantCultureIgnoreCase) != 0)
#else
if (string.Compare(destType, MSDeploy.Provider.DbDacFx, StringComparison.OrdinalIgnoreCase) != 0)
Expand Down Expand Up @@ -1337,7 +1337,7 @@ public static string DumpITaskItem(Framework.ITaskItem iTaskItem)

public static bool IsDeploymentWellKnownProvider(string strProvider)
{
#if NET472
#if NETFRAMEWORK
if (string.Compare(strProvider, MSDeploy.Provider.DbDacFx, StringComparison.InvariantCultureIgnoreCase) == 0)
#else
if (string.Compare(strProvider, MSDeploy.Provider.DbDacFx, StringComparison.OrdinalIgnoreCase) == 0)
Expand Down Expand Up @@ -1513,7 +1513,7 @@ static int ContainMsdeployFwlink(string errorMessage, out string? provider)

internal static bool IsType(Type type, Type? checkType)
{
#if NET472
#if NETFRAMEWORK
if (checkType != null && (type == checkType || type.IsSubclassOf(checkType)))
{
return true;
Expand Down Expand Up @@ -1566,7 +1566,7 @@ internal static void LogVsMsDeployException(Utilities.TaskLoggingHelper Log, Exc
lastDeploymentException = rootException;
}

#if NET472
#if NETFRAMEWORK
bool isWebException = rootException is System.Net.WebException;
if (isWebException)
{
Expand Down Expand Up @@ -1820,7 +1820,7 @@ internal static void SetupMSWebDeployDynamicAssemblies(string? strVersionsToTry,
MSWebDeploymentAssembly.SetVersion(version);

Version webDelegationAssemblyVersion = version;
#if NET472
#if NETFRAMEWORK
if (MSWebDeploymentAssembly.DynamicAssembly != null && MSWebDeploymentAssembly.DynamicAssembly.Assembly != null)
{
foreach (AssemblyName assemblyName in MSWebDeploymentAssembly.DynamicAssembly.Assembly.GetReferencedAssemblies())
Expand Down Expand Up @@ -1894,7 +1894,7 @@ internal static void SetupMSWebDeployDynamicAssemblies(string? strVersionsToTry,
/// </summary>
public static string? GetFullUserAgentString(string? userAgent)
{
#if NET472
#if NETFRAMEWORK
if(string.IsNullOrEmpty(userAgent))
return null;
try
Expand All @@ -1920,7 +1920,7 @@ internal static class ItemFilter

public static bool ItemFilterPipelineMetadata(Framework.ITaskItem item, string metadataName, string metadataValue, bool fIgnoreCase)
{
#if NET472
#if NETFRAMEWORK
return (string.Compare(item.GetMetadata(metadataName), metadataValue, fIgnoreCase, CultureInfo.InvariantCulture) == 0);
#else
return (string.Compare(item.GetMetadata(metadataName), metadataValue, fIgnoreCase) == 0);
Expand Down
8 changes: 4 additions & 4 deletions src/WebSdk/Publish/Tasks/MsDeploy/DynamicAssembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal class DynamicAssembly
public DynamicAssembly(string assemblyName, Version verToLoad, string publicKeyToken)
{
AssemblyFullName = string.Format(System.Globalization.CultureInfo.CurrentCulture, "{0}, Version={1}.{2}.0.0, Culture=neutral, PublicKeyToken={3}", assemblyName, verToLoad.Major, verToLoad.Minor, publicKeyToken);
#if NET472
#if NETFRAMEWORK
bool isAssemblyLoaded = false;
try
{
Expand All @@ -32,7 +32,7 @@ public DynamicAssembly(string assemblyName, Version verToLoad, string publicKeyT
Version = verToLoad;
}

#if NET472
#if NETFRAMEWORK
public static string TaskAssemblyDirectory
{
get
Expand Down Expand Up @@ -133,7 +133,7 @@ public bool TryGetEnumValue(string enumTypeName, string enumStrValue, out object
return createdObject;
}

#if NET472
#if NETFRAMEWORK
public object? CallStaticMethod(string typeName, string methodName, object[] arguments)
{
Type? t = GetType(typeName);
Expand Down Expand Up @@ -163,7 +163,7 @@ public bool TryGetEnumValue(string enumTypeName, string enumStrValue, out object
MethodCallExpression body = Expression.Call(Expression.Constant(d), invokeMethod, parameters);
var lambda = Expression.Lambda(body, parameters);
// Diagnostics.Debug.Assert(false, lambda.ToString());
#if NET472
#if NETFRAMEWORK
return Delegate.CreateDelegate(handlerType, lambda.Compile(), "Invoke", false);
#else
return null;
Expand Down
4 changes: 2 additions & 2 deletions src/WebSdk/Publish/Tasks/MsDeploy/VsMSDeployObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public VSMSDeployObject(string provider, string root)

// maybe we should show the "secure data to display"
// for now just suppress it.
#if NET472
#if NETFRAMEWORK
if (0 == string.Compare(m_provider, MSWebDeploymentAssembly.DynamicAssembly?.GetEnumValue(MSDeploy.TypeName.DeploymentWellKnownProvider, MSDeploy.Provider.DBFullSql)?.ToString(), StringComparison.InvariantCultureIgnoreCase)
|| 0 == string.Compare(m_provider, MSDeploy.Provider.DbDacFx , StringComparison.InvariantCultureIgnoreCase))
m_fNoDisplayRoot = true;
Expand Down Expand Up @@ -555,7 +555,7 @@ public void ResetBaseOptions()

public void SyncTo(VSMSDeployObject destObject, /*VSMSDeploySyncOption*/ dynamic syncOptions, IVSMSDeployHost _host)
{
#if NET472
#if NETFRAMEWORK
//$BUGBUG lmchen, there is only set to source provider?
// set up the provider setting
/*Deployment.DeploymentProviderOptions*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public override bool Execute()
WriteManifestsToFile(Log, m_manifests, ManifestFile);
}
}
#if NET472
#if NETFRAMEWORK
catch (Xml.XmlException ex)
{
Uri sourceUri = new(ex.SourceUri);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public override bool Execute()
}
}
}
#if NET472
#if NETFRAMEWORK
catch (Xml.XmlException ex)
{
Uri sourceUri = new(ex.SourceUri);
Expand Down
Loading
Loading