This repository has been archived by the owner on Jan 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This will need #7 first. |
jonathanpeppers
force-pushed
the
net5.0
branch
2 times, most recently
from
August 21, 2020 14:58
10df36b
to
d0f956a
Compare
pjcollins
reviewed
Aug 21, 2020
jonathanpeppers
force-pushed
the
net5.0
branch
2 times, most recently
from
August 21, 2020 15:21
dd13975
to
7a614e3
Compare
Should we bump the package version in the nuspec here? |
pjcollins
reviewed
Aug 21, 2020
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 The fix is to use the `.nuspec` instead of the `.fsproj`: -nuget pack Xamarin.Android.FSharp.ResourceProvider.fsproj +nuget pack Xamarin.Android.FSharp.ResourceProvider.nuspec I also made some changes to the Xamarin.Android project (just general cleanup): * Migrate from `packages.config` to `@(PackageReference)` * We can rely on `/restore` now in the build definition. `restoreNugetPackages` is deprecated, so we shouldn't use it. * Removed an `<Import/>` that was unused.
jonathanpeppers
force-pushed
the
net5.0
branch
from
August 21, 2020 15:46
c1d3005
to
e4725e3
Compare
pjcollins
approved these changes
Aug 21, 2020
jonathanpeppers
added a commit
to jonathanpeppers/xamarin-android
that referenced
this pull request
Aug 21, 2020
Context: xamarin/Xamarin.Android.FSharp.ResourceProvider#6 Xamarin.Android.FSharp.ResourceProvider 1.0.1 is now built for `netstandard2.0` and published to an internal feed. We should be able to enable F# tests under a `dotnet` context now. The `_RemoveLegacyDesigner` MSBuild target was running, when it shouldn't be for F# projects and adding a `Resource.designer.cs` `@(Compile)` item. I needed to add a `$(Language)` check. One workaround is for: dotnet/sdk#12954 We need to set `$(ProduceReferenceAssembly)` to `false` for .NET 5 F# projects at the moment.
jonathanpeppers
added a commit
to jonathanpeppers/xamarin-android
that referenced
this pull request
Aug 21, 2020
Context: xamarin/Xamarin.Android.FSharp.ResourceProvider#6 Xamarin.Android.FSharp.ResourceProvider 1.0.1 is now built for `netstandard2.0` and published to an internal feed. We should be able to enable F# tests under a `dotnet` context now. The `_RemoveLegacyDesigner` MSBuild target was running, when it shouldn't be for F# projects and adding a `Resource.designer.cs` `@(Compile)` item. I needed to add a `$(Language)` check. One workaround is for: dotnet/sdk#12954 We need to set `$(ProduceReferenceAssembly)` to `false` for .NET 5 F# projects at the moment.
jonathanpeppers
added a commit
to jonathanpeppers/xamarin-android
that referenced
this pull request
Aug 24, 2020
Context: xamarin/Xamarin.Android.FSharp.ResourceProvider#6 Xamarin.Android.FSharp.ResourceProvider 1.0.1 is now built for `netstandard2.0` and published to an internal feed. We should be able to enable F# tests under a `dotnet` context now. The `_RemoveLegacyDesigner` MSBuild target was running, when it shouldn't be for F# projects and adding a `Resource.designer.cs` `@(Compile)` item. I needed to add a `$(Language)` check. One workaround is for: dotnet/sdk#12954 We need to set `$(ProduceReferenceAssembly)` to `false` for .NET 5 F# projects at the moment.
jonathanpeppers
added a commit
to jonathanpeppers/xamarin-android
that referenced
this pull request
Sep 1, 2020
Context: xamarin/Xamarin.Android.FSharp.ResourceProvider#6 Xamarin.Android.FSharp.ResourceProvider 1.0.1 is now built for `netstandard2.0` and published to an internal feed. We should be able to enable F# tests under a `dotnet` context now. The `_RemoveLegacyDesigner` MSBuild target was running, when it shouldn't be for F# projects and adding a `Resource.designer.cs` `@(Compile)` item. I needed to add a `$(Language)` check. One workaround is for: dotnet/sdk#12954 We need to set `$(ProduceReferenceAssembly)` to `false` for .NET 5 F# projects at the moment.
jonathanpeppers
added a commit
to jonathanpeppers/xamarin-android
that referenced
this pull request
Sep 1, 2020
Context: xamarin/Xamarin.Android.FSharp.ResourceProvider#6 Xamarin.Android.FSharp.ResourceProvider 1.0.1 is now built for `netstandard2.0` and published to an internal feed. We should be able to enable F# tests under a `dotnet` context now. The `_RemoveLegacyDesigner` MSBuild target was running, when it shouldn't be for F# projects and adding a `Resource.designer.cs` `@(Compile)` item. I needed to add a `$(Language)` check. One workaround is for: dotnet/sdk#12954 We need to set `$(ProduceReferenceAssembly)` to `false` for .NET 5 F# projects at the moment.
jonathanpeppers
added a commit
to dotnet/android
that referenced
this pull request
Sep 2, 2020
Context: xamarin/Xamarin.Android.FSharp.ResourceProvider#6 Xamarin.Android.FSharp.ResourceProvider 1.0.1 is now built for `netstandard2.0` and published to an internal feed. We should be able to enable F# tests under a `dotnet` context now. The `_RemoveLegacyDesigner` MSBuild target was running, when it shouldn't be for F# projects and adding a `Resource.designer.cs` `@(Compile)` item. I needed to add a `$(Language)` check. One workaround is for: dotnet/sdk#12954 We need to set `$(ProduceReferenceAssembly)` to `false` for .NET 5 F# projects at the moment. The second workaround is for: dotnet/linker#1448 F# generics are causing an NRE in the linker.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trying to build an F# project under .NET 5 fails with:
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 benetstandard2.0
.This created a new issue when I tried to use the package in a .NET 5
project:
.NET 5.0 seems to prefer
netstandard2.0
overmonoandroid81
, and soit doesn't know what to do here: hence the error.
I literally, could run this command on the package and it works afterward:
The fix is to use the
.nuspec
instead of the.fsproj
:I also made some changes to the Xamarin.Android project (just general
cleanup):
packages.config
to@(PackageReference)
/restore
now in the build definition.restoreNugetPackages
is deprecated, so we shouldn't use it.<Import/>
that was unused.