.Net Standart + Live Player+ Xamarin Forms

Hello, I just started using Live Player, and I think is really nice, I love it so far!.
However, I was migrating a project to .net Standart and the player seems to be failing to find the embedded resources since they are not listed on the csproj, but the app actually compiles and it runs when debugging either on emulator or phone, but it fails on the player.
The error I get says MainActivity.cs The type or namespace name 'App' could not be found (are you missing a using directive or an assembly reference?)
To recreate this issue is enough to start a new xamarin forms project using PCL, and then adding a .Net standard library and following steps to replace the PCL to standard and then deleting the PCL. (Adding a new class library .net standard, adding references to xamarin forms, adding the App.xaml and MainPage.xaml to the standard class project, changing references on .droid and running)

Whenever I add the embedded resources and packages manually in the csproj of the standard class library, it works perfectly on live player but of course, the app does not compile as the errors saying duplicated resources pops up.

I saw on the [release notes] Release 1.1.547 we have the: .NET Standard Support (preview), I am not sure but I am guessing this refers to the android apk? In that case I can only download up to version 1.0.507, so probably that is my problem. How can I get version 1.1.547? (I already enroll to the beta program)

Hope someone can give me a hand with it and tell me what am I doing wrong.

Answers

  • AndrewHoeflingAndrewHoefling USMember

    As far as i know the live player still does not support net standard for iOS. I do not have an android device so I can't confirm if it works on android or not. I tested the Xamarin Live Player test flight build the other week and it still was not working. I am in the same boat as you and hope it works with net standard in the future.

  • RodrigoCollaoRodrigoCollao USMember ✭✭

    Yeah, I am waiting for it as well.
    If its what I think, I feel like it should be simple and they will release it pretty soon.
    If this helps you try editing the .csproj of the net standard class, and just add your app.xaml as embedded resource manually like a regular PCL does And you will see it working, at least on android. (I haven't yet receive my test flight for iPhone)

    But after you add that it will not build whenever you run for emulator or the phone as it will say you have double references to those embedded resources you added.

  • RodrigoCollaoRodrigoCollao USMember ✭✭

    Yeah, I am waiting for it as well.
    If its what I think, I feel like it should be simple and they will release it pretty soon.
    If this helps you try editing the .csproj of the net standard class, and just add

     <ItemGroup>
        <EmbeddedResource Include="MainPage.xaml">
          <SubType>Designer</SubType>
          <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
        </EmbeddedResource>
        <EmbeddedResource Include="App.xaml">
          <SubType>Designer</SubType>
          <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
        </EmbeddedResource>
      </ItemGroup>
      <ItemGroup>
        <Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
          <HintPath>..\..\packages\Xamarin.Forms.2.4.0.280\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Core.dll</HintPath>
        </Reference>
        <Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
          <HintPath>..\..\packages\Xamarin.Forms.2.4.0.280\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Platform.dll</HintPath>
        </Reference>
        <Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
          <HintPath>..\..\packages\Xamarin.Forms.2.4.0.280\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Xaml.dll</HintPath>
        </Reference>
      </ItemGroup>
      <ItemGroup>
    

    And you will see it working, at least on android. (I haven't yet receive my test flight for iPhone)

    But after you add that it will not build whenever you run for emulator or the phone as it will say you have double references to those embedded resources you added.

  • RodrigoCollaoRodrigoCollao USMember ✭✭

    Yeah, I am waiting for it as well.
    If its what I think, I feel like it should be simple and they will release it pretty soon.
    If this helps you try editing the .csproj of the net standard class, and just add

     <ItemGroup>
        <EmbeddedResource Include="MainPage.xaml">
          <SubType>Designer</SubType>
          <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
        </EmbeddedResource>
        <EmbeddedResource Include="App.xaml">
          <SubType>Designer</SubType>
          <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
        </EmbeddedResource>
      </ItemGroup>
      <ItemGroup>
        <Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
          <HintPath>..\..\packages\Xamarin.Forms.2.4.0.280\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Core.dll</HintPath>
        </Reference>
        <Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
          <HintPath>..\..\packages\Xamarin.Forms.2.4.0.280\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Platform.dll</HintPath>
        </Reference>
        <Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
          <HintPath>..\..\packages\Xamarin.Forms.2.4.0.280\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Xaml.dll</HintPath>
        </Reference>
      </ItemGroup>
      <ItemGroup>
    

    And you will see it working, at least on android. (I haven't yet receive my test flight for iPhone)

    But after you add that it will not build whenever you run for emulator or the phone as it will say you have double references to those embedded resources you added.

  • RodrigoCollaoRodrigoCollao USMember ✭✭

    Yeah, I am waiting for it as well.
    If its what I think, I feel like it should be simple and they will release it pretty soon.
    If this helps you try editing the .csproj of the net standard class, and just add

     <ItemGroup>
        <EmbeddedResource Include="MainPage.xaml">
          <SubType>Designer</SubType>
          <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
        </EmbeddedResource>
        <EmbeddedResource Include="App.xaml">
          <SubType>Designer</SubType>
          <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
        </EmbeddedResource>
      </ItemGroup>
      <ItemGroup>
        <Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
          <HintPath>..\..\packages\Xamarin.Forms.2.4.0.280\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Core.dll</HintPath>
        </Reference>
        <Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
          <HintPath>..\..\packages\Xamarin.Forms.2.4.0.280\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Platform.dll</HintPath>
        </Reference>
        <Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
          <HintPath>..\..\packages\Xamarin.Forms.2.4.0.280\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Xaml.dll</HintPath>
        </Reference>
      </ItemGroup>
      <ItemGroup>
    

    And you will see it working, at least on android. (I haven't yet receive my test flight for iPhone)

    But after you add that it will not build whenever you run for emulator or the phone as it will say you have double references to those embedded resources you added.

Sign In or Register to comment.