From f5257f1d2c9b71799a8528c3c797bf855e909b30 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 4 Nov 2020 13:27:36 -0800 Subject: [PATCH] build net472 of Microsoft.DotNet.DependencyMangager since the netstandard2.0 can't be ngened --- .../Microsoft.FSharp.Compiler.MSBuild.csproj | 2 +- .../Microsoft.DotNet.DependencyManager.fsproj | 3 ++- .../NativeDllResolveHandler.fs | 10 +++++++--- .../NativeDllResolveHandler.fsi | 2 +- .../Vsix/VisualFSharpFull/VisualFSharpFull.csproj | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/setup/Swix/Microsoft.FSharp.Compiler.MSBuild/Microsoft.FSharp.Compiler.MSBuild.csproj b/setup/Swix/Microsoft.FSharp.Compiler.MSBuild/Microsoft.FSharp.Compiler.MSBuild.csproj index ebccef01efe..9b03c15e580 100644 --- a/setup/Swix/Microsoft.FSharp.Compiler.MSBuild/Microsoft.FSharp.Compiler.MSBuild.csproj +++ b/setup/Swix/Microsoft.FSharp.Compiler.MSBuild/Microsoft.FSharp.Compiler.MSBuild.csproj @@ -101,7 +101,7 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp" file source="$(BinariesFolder)\FSharp.Core\$(Configuration)\netstandard2.0\FSharp.Core.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2 file source="$(BinariesFolder)\FSharp.Core\$(Configuration)\netstandard2.0\FSharp.Core.xml" file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\$(TargetFramework)\FSharp.Build.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2 - file source="$(BinariesFolder)\Microsoft.DotNet.DependencyManager\$(Configuration)\netstandard2.0\Microsoft.DotNet.DependencyManager.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2 + file source="$(BinariesFolder)\Microsoft.DotNet.DependencyManager\$(Configuration)\net472\Microsoft.DotNet.DependencyManager.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2 file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\$(TargetFramework)\Microsoft.Build.Framework.dll" file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\$(TargetFramework)\Microsoft.Build.Tasks.Core.dll" file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\$(TargetFramework)\Microsoft.Build.Utilities.Core.dll" diff --git a/src/fsharp/Microsoft.DotNet.DependencyManager/Microsoft.DotNet.DependencyManager.fsproj b/src/fsharp/Microsoft.DotNet.DependencyManager/Microsoft.DotNet.DependencyManager.fsproj index 6e700032fff..f77c694ff6f 100644 --- a/src/fsharp/Microsoft.DotNet.DependencyManager/Microsoft.DotNet.DependencyManager.fsproj +++ b/src/fsharp/Microsoft.DotNet.DependencyManager/Microsoft.DotNet.DependencyManager.fsproj @@ -4,8 +4,9 @@ Library - netstandard2.0 + netstandard2.0;net472 true + netstandard2.0 Microsoft.DotNet.DependencyManager $(NoWarn);45;55;62;75;1204 true diff --git a/src/fsharp/Microsoft.DotNet.DependencyManager/NativeDllResolveHandler.fs b/src/fsharp/Microsoft.DotNet.DependencyManager/NativeDllResolveHandler.fs index 8aab5e77c83..21eb3db8528 100644 --- a/src/fsharp/Microsoft.DotNet.DependencyManager/NativeDllResolveHandler.fs +++ b/src/fsharp/Microsoft.DotNet.DependencyManager/NativeDllResolveHandler.fs @@ -14,6 +14,7 @@ open Internal.Utilities.FSharpEnvironment /// host implements this, it's job is to return a list of package roots to probe. type NativeResolutionProbe = delegate of Unit -> seq +#if NETSTANDARD open System.Runtime.Loader // Cut down AssemblyLoadContext, for loading native libraries @@ -105,12 +106,15 @@ type NativeDllResolveHandlerCoreClr (nativeProbingRoots: NativeResolutionProbe) if not (isNull eventInfo) then eventInfo.RemoveEventHandler(AssemblyLoadContext.Default, handler) () +#endif -type NativeDllResolveHandler (nativeProbingRoots: NativeResolutionProbe) = - let handler:IDisposable option = +type NativeDllResolveHandler (_nativeProbingRoots: NativeResolutionProbe) = + let handler: IDisposable option = +#if NETSTANDARD if isRunningOnCoreClr then - Some (new NativeDllResolveHandlerCoreClr(nativeProbingRoots) :> IDisposable) + Some (new NativeDllResolveHandlerCoreClr(_nativeProbingRoots) :> IDisposable) else +#endif None let appendSemiColon (p:string) = diff --git a/src/fsharp/Microsoft.DotNet.DependencyManager/NativeDllResolveHandler.fsi b/src/fsharp/Microsoft.DotNet.DependencyManager/NativeDllResolveHandler.fsi index 05f5567cb36..7c14fa4b3ab 100644 --- a/src/fsharp/Microsoft.DotNet.DependencyManager/NativeDllResolveHandler.fsi +++ b/src/fsharp/Microsoft.DotNet.DependencyManager/NativeDllResolveHandler.fsi @@ -12,7 +12,7 @@ type NativeResolutionProbe = delegate of Unit -> seq type NativeDllResolveHandler = /// Construct a new NativeDllResolveHandler - new: nativeProbingRoots: NativeResolutionProbe -> NativeDllResolveHandler + new: _nativeProbingRoots: NativeResolutionProbe -> NativeDllResolveHandler member internal RefreshPathsInEnvironment: string seq -> unit diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj index 4e602393aeb..d9c37232e40 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj @@ -95,7 +95,7 @@ All 2 True - TargetFramework=netstandard2.0 + TargetFramework=net472 {DED3BBD7-53F4-428A-8C9F-27968E768605}