Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to multi-target UWP and Xamarin in F# project? #216

Open
xperiandri opened this issue Mar 16, 2020 · 0 comments
Open

How to multi-target UWP and Xamarin in F# project? #216

xperiandri opened this issue Mar 16, 2020 · 0 comments

Comments

@xperiandri
Copy link

I try to multi-target https://github.com/xperiandri/Elmish.Uno project to UWP and Xamarin.

<Project Sdk="MSBuild.Sdk.Extras/2.0.54">
  <PropertyGroup>
    <TargetFrameworks>netstandard2.0;xamarinios10;monoandroid90;uap10.0</TargetFrameworks>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
    <!--https://github.com/dotnet/fsharp/issues/7363#issuecomment-519270901-->
    <Deterministic>false</Deterministic>
    <!--<DebugType>portable</DebugType>-->
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="Utils.fs" />
    <Compile Include="Types.fs" />
    <Compile Include="Config.fs" />
    <Compile Include="Binding.fs" />
    <Compile Include="ViewModel.fs" />
    <Compile Include="ViewModelUtilities.fs" />
    <Compile Include="Program.fs" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Elmish" Version="3.0.6" />
    <PackageReference Include="Uno.Core" Version="1.29.0" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFramework)'=='xamarinios10' or '$(TargetFramework)'=='monoandroid80' or '$(TargetFramework)'=='monoandroid90' or '$(TargetFramework)'=='netstandard2.0'">
    <PackageReference Include="Uno.UI" Version="2.2.0-dev.171" />
  </ItemGroup>

  <ItemGroup Condition=" '$(TargetFramework)' == 'uap10.0' ">
    <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform " Version="6.2.9" />
  </ItemGroup>

</Project>

For Xamarin I get:

error NETSDK1005: Assets file 'C:\Users\Andrii\Dev\Frebo\Biblioteko\Elmish.Uno\src\Elmish.WPF\obj\project.assets.json' doesn't have a target for 'Xamarin.iOS,Version=v1.0'. Ensure that restore has run and that you have included 'xamarinios10' in the TargetFrameworks for your project.
error NETSDK1005: Assets file 'C:\Users\Andrii\Dev\Frebo\Biblioteko\Elmish.Uno\src\Elmish.WPF\obj\project.assets.json' doesn't have a target for 'MonoAndroid,Version=v9.0'. Ensure that restore has run and that you have included 'monoandroid90' in the TargetFrameworks for your project.

For UWP:

error NU1202: Package FSharp.Core 4.7.0 is not compatible with uap10.0 (UAP,Version=v10.0). Package FSharp.Core 4.7.0 supports:
error NU1202:   - net45 (.NETFramework,Version=v4.5)
error NU1202:   - netstandard2.0 (.NETStandard,Version=v2.0)
error NU1202: Package Elmish 3.0.6 is not compatible with uap10.0 (UAP,Version=v10.0). Package Elmish 3.0.6 supports:
error NU1202:   - net461 (.NETFramework,Version=v4.6.1)
error NU1202:   - netstandard1.6 (.NETStandard,Version=v1.6)
error NU1202:   - netstandard2.0 (.NETStandard,Version=v2.0)

Do you know how that can be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant