This repository has been archived by the owner on Jan 18, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trying to build an F# project under .NET 5 fails with: error FS3053 : The type provider 'Xamarin.Android.FSharp.ResourceProvider' reported an error : The type provider constructor has thrown an exception: Could not load file or assembly 'System.CodeDom, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified. We need this library to target `netstandard2.0`, so it will work on .NET framework, Mono, and .NET Core (.NET 5+). I reworked `Xamarin.Android.FSharp.ResourceProvider.fsproj` to be `netstandard2.0`. This created a new issue when I tried to *use* the package in a .NET 5 project: Foo.Android.fsproj : error NU1202: Package Xamarin.Android.FSharp.ResourceProvider 1.0.0.29 is not compatible with net5.0 (net5.0). Package Xamarin.Android.FSharp.ResourceProvider 1.0.0.29 supports: Foo.Android.fsproj : error NU1202: - monoandroid81 (MonoAndroid,Version=v8.1) Foo.Android.fsproj : error NU1202: - netstandard2.0 (.NETStandard,Version=v2.0) .NET 5.0 seems to prefer `netstandard2.0` over `monoandroid81`, and so it doesn't know what to do here: hence the error. I literally, could run this command on the package and it works afterward: zip -d Xamarin.Android.FSharp.ResourceProvider.1.0.0.29.nupkg lib/netstandard2.0/Xamarin.Android.Fsharp.ResourceProvider.dll I tried for a bit to find a workaround, but I could not find a setting in the `.nuspec` file that would prevent the `netstandard2.0` library from being added. I ended up adding this to the build definition. I also made some changes to the Xamarin.Android project (just general cleanup): * Migrate from `packages.config` to `@(PackageReference)` * We can use `/restore` now in the build definition. * Removed an `<Import/>` that was unused.
- Loading branch information