Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
991eef8
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] May 30, 2025
58d1449
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 3, 2025
4193c78
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 4, 2025
f9405c3
Merge branch 'main' into darc-main-243912c4-b7a9-4680-874c-2532b3aaecf2
T-Gro Jun 4, 2025
64f4da0
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 5, 2025
ec5701f
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 6, 2025
455f15f
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 7, 2025
aae41d9
Merge branch 'main' into darc-main-243912c4-b7a9-4680-874c-2532b3aaecf2
T-Gro Jun 10, 2025
a6eb5c5
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 13, 2025
5279374
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 14, 2025
0773258
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 17, 2025
1df4739
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 18, 2025
f3b7644
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 19, 2025
0dda475
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 20, 2025
f13bde7
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 21, 2025
43ad96f
Merge branch 'main' into darc-main-243912c4-b7a9-4680-874c-2532b3aaecf2
T-Gro Jun 23, 2025
d5cdef1
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 24, 2025
63aa02d
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 25, 2025
d4d84fe
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 26, 2025
b99cd8e
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 27, 2025
339f646
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 28, 2025
2c04f07
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jun 30, 2025
02c005f
Merge branch 'main' into darc-main-243912c4-b7a9-4680-874c-2532b3aaecf2
T-Gro Jun 30, 2025
e236753
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 1, 2025
b68d2b4
Merge branch 'main' into darc-main-243912c4-b7a9-4680-874c-2532b3aaecf2
T-Gro Jul 1, 2025
9ed463d
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 2, 2025
523cce8
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 3, 2025
42d0e33
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 4, 2025
5a30771
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 5, 2025
de615cd
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 8, 2025
8dc7325
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 9, 2025
d8a5424
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 10, 2025
027f3ef
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 11, 2025
eb5fe1c
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 15, 2025
a09866a
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 16, 2025
35419e1
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 17, 2025
04a65fe
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 18, 2025
64b5add
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 19, 2025
2eb933c
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 22, 2025
a7e6682
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 23, 2025
b408f39
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 24, 2025
3f1b4c5
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 25, 2025
284eb13
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 26, 2025
24ecf58
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 29, 2025
72ce34e
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Jul 31, 2025
17c2458
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 1, 2025
bf9590d
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 2, 2025
355f86d
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 5, 2025
486ed43
Merge branch 'main' into darc-main-243912c4-b7a9-4680-874c-2532b3aaecf2
akoeplinger Aug 5, 2025
f11172b
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 5, 2025
a9d6e1c
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 6, 2025
c114a1d
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 7, 2025
32f4fdb
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 8, 2025
d6ee71b
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 13, 2025
11cff8b
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 14, 2025
04aeedc
Merge branch 'main' into darc-main-243912c4-b7a9-4680-874c-2532b3aaecf2
T-Gro Aug 14, 2025
229921a
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 15, 2025
0108172
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 16, 2025
69bc09e
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 19, 2025
46d9a9f
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 20, 2025
72535ed
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 21, 2025
2b10d1f
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 22, 2025
f4414b7
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 23, 2025
e4a07f7
Merge branch 'main' into darc-main-243912c4-b7a9-4680-874c-2532b3aaecf2
T-Gro Aug 26, 2025
612ee26
Merge branch 'main' into darc-main-243912c4-b7a9-4680-874c-2532b3aaecf2
T-Gro Aug 26, 2025
8301538
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 27, 2025
2c9fc2a
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 28, 2025
081c787
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 29, 2025
2c57827
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Aug 30, 2025
51a2832
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Sep 2, 2025
46a7a08
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Sep 3, 2025
6c80141
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Sep 5, 2025
8d6f8aa
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Sep 6, 2025
71b256f
Merge branch 'main' into darc-main-243912c4-b7a9-4680-874c-2532b3aaecf2
T-Gro Sep 8, 2025
e266892
add net481
T-Gro Sep 8, 2025
94cf7eb
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Sep 9, 2025
468fa18
hit it
T-Gro Sep 9, 2025
e57b8c5
moaarr
T-Gro Sep 9, 2025
507cbdd
try yml based solution
T-Gro Sep 9, 2025
c69fcfa
imba powerful instrumentation now
T-Gro Sep 9, 2025
9fcbd66
fantomas
T-Gro Sep 9, 2025
f6d8c58
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Sep 10, 2025
a98494e
one more time
T-Gro Sep 10, 2025
46a70bb
Merge branch 'darc-main-243912c4-b7a9-4680-874c-2532b3aaecf2' of http…
T-Gro Sep 10, 2025
3a0b717
gogogo
T-Gro Sep 10, 2025
53eadc6
one more time...
T-Gro Sep 10, 2025
ecb6b15
ok try now
T-Gro Sep 10, 2025
96ee26a
try with another ass
T-Gro Sep 10, 2025
864ee65
more instrumentation added
T-Gro Sep 10, 2025
fa1ac81
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Sep 11, 2025
6b22a41
Merge branch 'main' into darc-main-243912c4-b7a9-4680-874c-2532b3aaecf2
T-Gro Sep 11, 2025
e597765
Merge branch 'main' into darc-main-243912c4-b7a9-4680-874c-2532b3aaecf2
T-Gro Sep 11, 2025
22dbe74
Update Microsoft.FSharp.Targets
T-Gro Sep 11, 2025
35fbd6e
Update Microsoft.FSharp.Targets
T-Gro Sep 11, 2025
420dc00
one more time
T-Gro Sep 11, 2025
74789ee
Update Microsoft.FSharp.Targets
T-Gro Sep 11, 2025
20ae1c4
Restore Microsoft.FSharp.Targets from main
T-Gro Sep 11, 2025
549653d
moaarr instrumentation
T-Gro Sep 11, 2025
e28ca63
Do it. Do it NOW!
T-Gro Sep 11, 2025
209011b
Update dependencies from https://github.com/dotnet/msbuild build 2025…
dotnet-maestro[bot] Sep 12, 2025
f166d14
mooooarrr instrumentation
T-Gro Sep 12, 2025
95514e5
Merge branch 'darc-main-243912c4-b7a9-4680-874c-2532b3aaecf2' of http…
T-Gro Sep 12, 2025
aaaabd4
one more time
T-Gro Sep 12, 2025
0271718
Initial plan
Copilot Sep 12, 2025
cce13cd
Implement robust Visual Studio installation discovery with graceful f…
Copilot Sep 12, 2025
497e728
Add release notes and fix vswhere logic in VSInstallDiscovery
Copilot Sep 12, 2025
98ad567
Delete docs/release-notes/.VisualStudio/17.15.md
T-Gro Sep 16, 2025
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
63 changes: 63 additions & 0 deletions azure-pipelines-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,69 @@ stages:
- checkout: self
clean: true

- task: PowerShell@2
displayName: Detect / ensure VisualStudioVersion=17.0 (testVs only)
condition: and(succeeded(), eq(variables._testKind, 'testVs'))
inputs:
targetType: inline
pwsh: false
script: |
Write-Host "VS Detect: starting"

function Set-VSV([string]$v) {
$env:VisualStudioVersion = $v
Write-Host "##vso[task.setvariable variable=VisualStudioVersion]$v"
Write-Host "VS Detect: SET VisualStudioVersion=$v"
}

$vswhere = $null
$cmd = Get-Command vswhere.exe -ErrorAction SilentlyContinue
if ($cmd) {
$vswhere = $cmd.Source
} else {
$candidates = @(
"$env:ProgramFiles(x86)\Microsoft Visual Studio\Installer\vswhere.exe",
"$env:ProgramFiles\Microsoft Visual Studio\Installer\vswhere.exe"
)
foreach ($c in $candidates) { if (Test-Path $c) { $vswhere = $c; break } }
}

if ($vswhere -and (Test-Path $vswhere)) {
Write-Host "VS Detect: using vswhere '$vswhere'"
$json = & $vswhere -latest -prerelease -products * -format json 2>$null
if ($LASTEXITCODE -eq 0 -and $json) {
try {
$obj = $json | ConvertFrom-Json
if ($obj -is [System.Array]) { $obj = $obj[0] }
$ver = $obj.installationVersion
Write-Host "VS Detect: installationVersion=$ver"
if ($ver -match '^17\.') {
if (-not $env:VisualStudioVersion) { Set-VSV "17.0" }
} else {
Write-Host "VS Detect: latest VS not 17.x (ver=$ver) – leaving fallback logic"
}
} catch {
Write-Host "VS Detect: JSON parse failed: $($_.Exception.Message)"
}
} else {
Write-Host "VS Detect: vswhere produced no usable data"
}
} else {
Write-Host "VS Detect: vswhere not found"
}

if (-not $env:VisualStudioVersion) {
Write-Host "VS Detect: forcing VisualStudioVersion=17.0 (fallback)"
Set-VSV "17.0"
}

$final = if ($env:VisualStudioVersion) { $env:VisualStudioVersion } else { "<unset>" }
Write-Host "VS Detect: done (final VisualStudioVersion='$final')"

- script: echo VisualStudioVersion=$(VisualStudioVersion)
displayName: Echo VisualStudioVersion
condition: and(succeeded(), eq(variables._testKind, 'testVs'))

- powershell: eng\SetupVSHive.ps1
displayName: Setup VS Hive
condition: eq(variables.setupVsHive, 'true')
Expand Down
8 changes: 4 additions & 4 deletions eng/Version.Details.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ This file should be imported by eng/Versions.props
<Project>
<PropertyGroup>
<!-- dotnet/msbuild dependencies -->
<MicrosoftBuildPackageVersion>17.15.0-preview-25278-01</MicrosoftBuildPackageVersion>
<MicrosoftBuildFrameworkPackageVersion>17.15.0-preview-25278-01</MicrosoftBuildFrameworkPackageVersion>
<MicrosoftBuildTasksCorePackageVersion>17.15.0-preview-25278-01</MicrosoftBuildTasksCorePackageVersion>
<MicrosoftBuildUtilitiesCorePackageVersion>17.15.0-preview-25278-01</MicrosoftBuildUtilitiesCorePackageVersion>
<MicrosoftBuildPackageVersion>17.15.0-preview-25461-02</MicrosoftBuildPackageVersion>
<MicrosoftBuildFrameworkPackageVersion>17.15.0-preview-25461-02</MicrosoftBuildFrameworkPackageVersion>
<MicrosoftBuildTasksCorePackageVersion>17.15.0-preview-25461-02</MicrosoftBuildTasksCorePackageVersion>
<MicrosoftBuildUtilitiesCorePackageVersion>17.15.0-preview-25461-02</MicrosoftBuildUtilitiesCorePackageVersion>
<!-- dotnet/runtime dependencies -->
<SystemCollectionsImmutablePackageVersion>9.0.0</SystemCollectionsImmutablePackageVersion>
<SystemComponentModelCompositionPackageVersion>9.0.0</SystemComponentModelCompositionPackageVersion>
Expand Down
16 changes: 8 additions & 8 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
<Dependencies>
<Source Uri="https://github.com/dotnet/dotnet" Mapping="fsharp" Sha="8ea69c337be69385ff7eb44b2a54db78010110d8" BarId="282240" />
<ProductDependencies>
<Dependency Name="Microsoft.Build" Version="17.15.0-preview-25278-01">
<Dependency Name="Microsoft.Build" Version="17.15.0-preview-25461-02">
<Uri>https://github.com/dotnet/msbuild</Uri>
<Sha>6de64741f6440bb6730d9a342934ce49d600fcc9</Sha>
<Sha>610aa6fdc1ab787670d0ba2db53a4546ae63a874</Sha>
</Dependency>
<Dependency Name="Microsoft.Build.Framework" Version="17.15.0-preview-25278-01">
<Dependency Name="Microsoft.Build.Framework" Version="17.15.0-preview-25461-02">
<Uri>https://github.com/dotnet/msbuild</Uri>
<Sha>6de64741f6440bb6730d9a342934ce49d600fcc9</Sha>
<Sha>610aa6fdc1ab787670d0ba2db53a4546ae63a874</Sha>
</Dependency>
<Dependency Name="Microsoft.Build.Tasks.Core" Version="17.15.0-preview-25278-01">
<Dependency Name="Microsoft.Build.Tasks.Core" Version="17.15.0-preview-25461-02">
<Uri>https://github.com/dotnet/msbuild</Uri>
<Sha>6de64741f6440bb6730d9a342934ce49d600fcc9</Sha>
<Sha>610aa6fdc1ab787670d0ba2db53a4546ae63a874</Sha>
</Dependency>
<Dependency Name="Microsoft.Build.Utilities.Core" Version="17.15.0-preview-25278-01">
<Dependency Name="Microsoft.Build.Utilities.Core" Version="17.15.0-preview-25461-02">
<Uri>https://github.com/dotnet/msbuild</Uri>
<Sha>6de64741f6440bb6730d9a342934ce49d600fcc9</Sha>
<Sha>610aa6fdc1ab787670d0ba2db53a4546ae63a874</Sha>
</Dependency>
<Dependency Name="System.Reflection.Metadata" Version="9.0.0">
<Uri>https://github.com/dotnet/runtime</Uri>
Expand Down
56 changes: 56 additions & 0 deletions fuckingtest.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# (A1) Build (Release) – create all artifacts needed by tests
.\Build.cmd -c Release

# (A2) Set up the VS experimental hive (same as CI step 'Setup VS Hive')
# This script will:
# - Discover / validate a VS 17.x install
# - Set / persist required hive registry + layout
# - Emit the required environment variables in the current session
# If it has a -Configuration parameter in your branch, pass it; otherwise omit.
powershell -ExecutionPolicy Bypass -File .\eng\SetupVSHive.ps1 -Configuration Release

# (A3) (Optional) Verify env vars now exist
"`nVSAPPIDDIR=$env:VSAPPIDDIR"
"VS170COMNTOOLS=$env:VS170COMNTOOLS"

if (-not $env:VSAPPIDDIR -or -not $env:VS170COMNTOOLS) {
Write-Host "Hive setup did not set required env vars. Aborting." -ForegroundColor Red
exit 1
}

# (A4) Path to the unit test assembly
$testDll = Join-Path $PWD "artifacts\bin\VisualFSharp.UnitTests\Release\net472\VisualFSharp.UnitTests.dll"

if (-not (Test-Path $testDll)) {
Write-Host "Test assembly missing: $testDll" -ForegroundColor Red
exit 1
}

# (A5) Enable your instrumentation
$env:FSharpAutoImportDiag = "1"
$env:FSharpTargetsDiagnostic = "true"

# (A6) Run only the failing test using vstest.console (closer to CI than dotnet test for VS integration)
$vswhere = Join-Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer" "vswhere.exe"
if (-not (Test-Path $vswhere)) {
Write-Host "vswhere.exe not found; ensure VS 2022 installed." -ForegroundColor Yellow
}

# Optionally locate vstest.console if not on PATH
$vstest = Get-ChildItem -Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio" -Recurse -Include vstest.console.exe -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -like "*\Common7\IDE\Extensions\TestPlatform\vstest.console.exe" } |
Sort-Object Length | Select-Object -First 1

if (-not $vstest) {
Write-Host "Could not locate vstest.console.exe; falling back to 'dotnet test'." -ForegroundColor Yellow
dotnet test $testDll --framework net472 --filter "FullyQualifiedName=Tests.ProjectSystem.ProjectItems.RemoveAssemblyReference.NoIVsTrackProjectDocuments2Events"
exit $LASTEXITCODE
}

& $vstest.FullName `
$testDll `
/Framework:".NETFramework,Version=v4.7.2" `
/TestCaseFilter:"FullyQualifiedName=Tests.ProjectSystem.ProjectItems.RemoveAssemblyReference.NoIVsTrackProjectDocuments2Events" `
/Logger:trx /InIsolation

Write-Host "`nDone."
17 changes: 16 additions & 1 deletion src/Compiler/Facilities/SimulatedMSBuildReferenceResolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,23 @@ let private Net472 = "v4.7.2"
[<Literal>]
let private Net48 = "v4.8"

[<Literal>]
let private Net481 = "v4.8.1"

let SupportedDesktopFrameworkVersions =
[ Net48; Net472; Net471; Net47; Net462; Net461; Net46; Net452; Net451; Net45 ]
[
Net481
Net48
Net472
Net471
Net47
Net462
Net461
Net46
Net452
Net451
Net45
]

let private SimulatedMSBuildResolver =

Expand Down
17 changes: 16 additions & 1 deletion src/FSharp.Build/Fsc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,22 @@ type public Fsc() as this =
| "" -> ()
| NonNull dotnetFscCompilerPath -> builder.AppendSwitch(dotnetFscCompilerPath)

builder.ToString()
let cmd = builder.ToString()

// FWDIAG-FSC
try
let nf = noFramework
let refs =
match references with
| arr -> arr.Length
System.Diagnostics.Trace.WriteLine(
sprintf "FWDIAG-FSC VS=%s NoFramework=%b RefCount=%d OutputAssembly=%s"
(System.Environment.GetEnvironmentVariable("VisualStudioVersion"))
nf refs outputAssembly
)
with _ -> ()

cmd

override _.GenerateResponseFileCommands() =
let builder = generateCommandLineBuilder ()
Expand Down
22 changes: 22 additions & 0 deletions src/FSharp.Build/Microsoft.FSharp.Targets
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,28 @@ this file.
<UsingXBuild Condition="'$(MSBuildAssemblyVersion)' == ''">true</UsingXBuild>
</PropertyGroup>

<!-- DIAGNOSTIC: opt‑in legacy reference resolution tracing -->
<PropertyGroup>
<!-- Enable with: /p:FSharpTargetsDiagnostic=true -->
<FSharpTargetsDiagnostic Condition="'$(FSharpTargetsDiagnostic)'==''">false</FSharpTargetsDiagnostic>
</PropertyGroup>

<Target Name="FSharpLegacyRefDiag"
AfterTargets="ResolveAssemblyReferences"
Condition="'$(FSharpTargetsDiagnostic)'=='true'">
<Message Importance="high" Text="FSharpDiag: ===== Legacy Reference Resolution Diagnostics BEGIN =====" />
<Message Importance="high" Text="FSharpDiag: VisualStudioVersion=$(VisualStudioVersion) MSBuildToolsVersion=$(MSBuildToolsVersion) MSBuildAssemblyVersion=$(MSBuildAssemblyVersion)" />
<Message Importance="high" Text="FSharpDiag: TargetFrameworkIdentifier=$(TargetFrameworkIdentifier) TargetFrameworkVersion=$(TargetFrameworkVersion) TargetFrameworkProfile=$(TargetFrameworkProfile)" />
<Message Importance="high" Text="FSharpDiag: FSharp_Shim_Present=$(FSharp_Shim_Present) FSharpPreferNetFrameworkTools=$(FSharpPreferNetFrameworkTools) FSharpPrefer64BitTools=$(FSharpPrefer64BitTools) FSharpPreferAnyCpuTools=$(FSharpPreferAnyCpuTools)" />
<Message Importance="high" Text="FSharpDiag: FscToolPath=$(FscToolPath) FscToolExe=$(FscToolExe) DotnetFscCompilerPath=$(DotnetFscCompilerPath)" />
<Message Importance="high" Text="FSharpDiag: DisableImplicitFrameworkReferences=$(DisableImplicitFrameworkReferences) ImplicitlyExpandDesignTimeFacades=$(ImplicitlyExpandDesignTimeFacades)" />
<Message Importance="high" Text="FSharpDiag: Reference Identities: @(Reference->'%(Identity)')" />
<Message Importance="high" Text="FSharpDiag: Reference HintPaths: @(Reference->'%(Identity)=%(HintPath)')" />
<Message Importance="high" Text="FSharpDiag: ReferencePathWithRefAssemblies (count=%(ReferencePathWithRefAssemblies.Identity->Count())): @(ReferencePathWithRefAssemblies)" />
<Message Importance="high" Text="FSharpDiag: Raw Fsc References Arg Source: @(ReferencePathWithRefAssemblies->'%(Filename)')" />
<Message Importance="high" Text="FSharpDiag: ===== Legacy Reference Resolution Diagnostics END =====" />
</Target>

<Target
Name="CreateManifestResourceNames"
Condition="'@(EmbeddedResource)' != ''"
Expand Down
22 changes: 20 additions & 2 deletions src/LegacyMSBuildResolver/LegacyMSBuildReferenceResolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,23 @@ let private Net472 = "v4.7.2"
[<Literal>]
let private Net48 = "v4.8"

[<Literal>]
let private Net481 = "v4.8.1"

let SupportedDesktopFrameworkVersions =
[ Net48; Net472; Net471; Net47; Net462; Net461; Net46; Net452; Net451; Net45 ]
[
Net481
Net48
Net472
Net471
Net47
Net462
Net461
Net46
Net452
Net451
Net45
]

/// Get the path to the .NET Framework implementation assemblies by using ToolLocationHelper.GetPathToDotNetFramework
/// This is only used to specify the "last resort" path for assembly resolution.
Expand All @@ -87,6 +102,7 @@ let GetPathToDotNetFrameworkImplementationAssemblies v : string list =
| Net471 -> Some TargetDotNetFrameworkVersion.Version471
| Net472 -> Some TargetDotNetFrameworkVersion.Version472
| Net48 -> Some TargetDotNetFrameworkVersion.Version48
| Net481 -> Some TargetDotNetFrameworkVersion.Version481
| _ ->
assert false
None
Expand Down Expand Up @@ -114,7 +130,9 @@ let GetPathToDotNetFrameworkReferenceAssemblies version =
let HighestInstalledRefAssembliesOrDotNETFramework () =
let getHighestInstalledDotNETFramework () =
try
if not (isNull (box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version48)))) then
if not (isNull (box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version481)))) then
Net481
elif not (isNull (box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version48)))) then
Net48
elif not (isNull (box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version472)))) then
Net472
Expand Down
9 changes: 9 additions & 0 deletions vsintegration/src/FSharp.LanguageService/FSharpSource.fs
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,15 @@ type internal FSharpSource_DEPRECATED(service:LanguageService_DEPRECATED, textLi
yield "--define:COMPILED"

|]

// FWDIAG LS
try
let hasNF = flags |> Array.exists ((=) "--noframework")
System.Diagnostics.Trace.WriteLine(sprintf "FWDIAG-LS GetParseTree VS=%s hasNoFramework=%b flags=%A"
(System.Environment.GetEnvironmentVariable("VisualStudioVersion"))
hasNF flags)
with _ -> ()

// get a sync parse of the file
let co, _ =
{ ProjectFileName = fileName + ".dummy.fsproj"
Expand Down
Loading
Loading