Closed luithefirst closed 4 years ago
This looks like an F# metadata read error. @cartermp can this be expected with older versions of the compiler?
This is a forwards-compat problem. In 5.3.2 did you use anonymous records anywhere? That will add new metadata to the F# metadata blob and make the .dll
not consumable by older compilers.
Yes, looks like it is being used for internals. The addition can be seen in the commit linked in the OP.
Yep. Nothing can be done to work around this for older compilers, unfortunately. It's either not supported for F# 4.5 or lower, or the package will need to update to no longer use anonymous records.
In that case I'd be inclined to say that it probably doesn't make sense to support older compiler versions. While I could replace that particular anonymous record with a tuple, we have no good way of guarding against future regressions.
Right, the new code is using an anonymous record and this perfectly explains the compiler error.
Thanks for the analysis and clarification of the development future.
I’m having that issue while using the .net 5 preview 8 that was released a day or so ago, and the latest F# compiler. I moved back the project to .net core 3.1 and had the issue again, while .net 5 is installed. That’s on MacOS. I haven’t tried .net 4.7 since I didn’t use it in years.
Are you able to build from the command line? I believe you mentioned that the issue only happened on VS mac, so maybe the tooling there is out of date?
VSMac tooling is out of date. It uses Mono at design time which is still stuck on F# 4.5
I think there is a combination of problems:
using:
I get the following:
An update to FsPickler to 5.3.2 breaks the build of our solution in VS 2017 / MSBuild 15 with Visual F# Tools 10.2 for F# 4.5 15.8.0.0. The prior version FsPickler 5.3.1 works fine.
Steps to reproduce:
Adding the assembly reference breaks the build with the following error:
In VS 2019 / MSBuild 16 the solution builds as intended.
When I build FsPickler locally it results in the same error. By reverting the recent commits I could figure out that the changes in https://github.com/mbraceproject/FsPickler/commit/8d5fd5cf5ef0b97737e3a4bdceb615a61a81e77f "Use assembly load context when loading assemblies" have introduced this issue.
For me, it's not clear why the changes result in this error and the output of the FSC seems to be misleading.
It does not look like that a restriction to MSBuild 16 was intended. It would be great if someone could have a look at this and find a compatible solution.