dotnet / dotnet/fsharp

It seems that global.json is ignored, causing a runtime MethodAccessException in F# due to using a specific SDK.

Open
#17,992 0 comments 0 reactions 1 assignee Claimed by @KevinRansom View on GitHub
Bug Impact-Low
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/It-seems-that-globaljson-is-ignored-ca/10780523)._

---
\[severity:I’m unable to use this version\] \[regression\]
MethodAccessException on equality comparison of a record with private fields but only when building from visual studio (17.11.5).
This is a known issue related to a bug in the SDK, see the following github issue [17447](https://github.com/dotnet/fsharp/issues/17447).

However the SDK should be pinned at 8.0.300 by the global.json file, this SDK version should **not** have this problem.
When building using `dotnet build` from the command line, this problem does not exist so it seems in that case the correct sdk (specified in global.json) is used.

Please find more details, reproduction repository and discussion in the following github issue [17925](https://github.com/dotnet/fsharp/issues/17925).
I attached the binlog of a clean build of the [reproduction repository](https://github.com/OkkeHendriks/equals).

---
### Original Comments

#### Feedback Bot on 11/1/2024, 02:22 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

---
### Original Solutions

#### Okke Hendriks solved on 10/31/2024, 10:49 AM, undefined votes:

Use dotnet build from the command line instead.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.