Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit f84d529

Browse files
brettfonosami
authored andcommitted
build net472 of Microsoft.DotNet.DependencyMangager since the netstandard2.0 can't be ngened (dotnet#10390)
1 parent efdef78 commit f84d529

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

setup/Swix/Microsoft.FSharp.Compiler.MSBuild/Microsoft.FSharp.Compiler.MSBuild.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp"
101101
file source="$(BinariesFolder)\FSharp.Core\$(Configuration)\netstandard2.0\FSharp.Core.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2
102102
file source="$(BinariesFolder)\FSharp.Core\$(Configuration)\netstandard2.0\FSharp.Core.xml"
103103
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\$(TargetFramework)\FSharp.Build.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2
104-
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
104+
file source="$(BinariesFolder)\Microsoft.DotNet.DependencyManager\$(Configuration)\net472\Microsoft.DotNet.DependencyManager.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2
105105
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\$(TargetFramework)\Microsoft.Build.Framework.dll"
106106
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\$(TargetFramework)\Microsoft.Build.Tasks.Core.dll"
107107
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\$(TargetFramework)\Microsoft.Build.Utilities.Core.dll"

src/fsharp/Microsoft.DotNet.DependencyManager/Microsoft.DotNet.DependencyManager.fsproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
<PropertyGroup>
66
<OutputType>Library</OutputType>
7-
<TargetFrameworks>netstandard2.0</TargetFrameworks>
7+
<TargetFrameworks>netstandard2.0;net472</TargetFrameworks>
88
<IsPackable>true</IsPackable>
9+
<TargetFrameworks Condition="'$(OS)' == 'Unix'">netstandard2.0</TargetFrameworks>
910
<AssemblyName>Microsoft.DotNet.DependencyManager</AssemblyName>
1011
<NoWarn>$(NoWarn);45;55;62;75;1204</NoWarn>
1112
<AllowCrossTargeting>true</AllowCrossTargeting>

src/fsharp/Microsoft.DotNet.DependencyManager/NativeDllResolveHandler.fs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ open Internal.Utilities.FSharpEnvironment
1414
/// host implements this, it's job is to return a list of package roots to probe.
1515
type NativeResolutionProbe = delegate of Unit -> seq<string>
1616

17+
#if NETSTANDARD
1718
open System.Runtime.Loader
1819

1920
// Cut down AssemblyLoadContext, for loading native libraries
@@ -105,12 +106,15 @@ type NativeDllResolveHandlerCoreClr (nativeProbingRoots: NativeResolutionProbe)
105106
if not (isNull eventInfo) then
106107
eventInfo.RemoveEventHandler(AssemblyLoadContext.Default, handler)
107108
()
109+
#endif
108110

109-
type NativeDllResolveHandler (nativeProbingRoots: NativeResolutionProbe) =
110-
let handler:IDisposable option =
111+
type NativeDllResolveHandler (_nativeProbingRoots: NativeResolutionProbe) =
112+
let handler: IDisposable option =
113+
#if NETSTANDARD
111114
if isRunningOnCoreClr then
112-
Some (new NativeDllResolveHandlerCoreClr(nativeProbingRoots) :> IDisposable)
115+
Some (new NativeDllResolveHandlerCoreClr(_nativeProbingRoots) :> IDisposable)
113116
else
117+
#endif
114118
None
115119

116120
let appendSemiColon (p:string) =

src/fsharp/Microsoft.DotNet.DependencyManager/NativeDllResolveHandler.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type NativeResolutionProbe = delegate of Unit -> seq<string>
1212
type NativeDllResolveHandler =
1313

1414
/// Construct a new NativeDllResolveHandler
15-
new: nativeProbingRoots: NativeResolutionProbe -> NativeDllResolveHandler
15+
new: _nativeProbingRoots: NativeResolutionProbe -> NativeDllResolveHandler
1616

1717
member internal RefreshPathsInEnvironment: string seq -> unit
1818

vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
<NgenArchitecture>All</NgenArchitecture>
9696
<NgenPriority>2</NgenPriority>
9797
<Private>True</Private>
98-
<AdditionalProperties>TargetFramework=netstandard2.0</AdditionalProperties>
98+
<AdditionalProperties>TargetFramework=net472</AdditionalProperties>
9999
</ProjectReference>
100100
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj">
101101
<Project>{DED3BBD7-53F4-428A-8C9F-27968E768605}</Project>

0 commit comments

Comments
 (0)