locked
How to Connect to a ASP.NET Core 3.0 Service RRS feed

  • Question

  • User1456895836 posted

    With the retirement of WCF and .svc files, I decided to rebuild the backend to new ASP.NET Core 3.0.x preview. Is there documentation on how to replace the WCF functionality to access the new service format, especially from my Xamarin PCL?

    Wednesday, September 4, 2019 4:00 PM

All replies

  • User-474980206 posted

    the default is a simple json REST api. any client network library can be used. it is helpful to implement swagger with your api to document the api, and have test tools.

    note: PCL's are coming to their end of life. 

    Wednesday, September 4, 2019 4:16 PM
  • User1289604957 posted

    Hello,

    You can use <g class="gr_ gr_105 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="105" data-gr-id="105">gRPC</g> services with ASP.NET Core 3.0 as a backend :

    https://docs.microsoft.com/en-us/aspnet/core/grpc/aspnetcore?view=aspnetcore-3.0&tabs=visual-studio

    Best regards,

    Maher

    Wednesday, September 4, 2019 4:21 PM
  • User1456895836 posted

    Is gRPC on the client side cross-platform compatible? I have started reading your link, but haven't gotten to an answer. From a comparative, it looks like a better solution for my application than simple http.

    Wednesday, September 4, 2019 5:46 PM
  • User1289604957 posted

    Is gRPC on the <g class="gr_ gr_101 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="101" data-gr-id="101">client side</g> cross-platform compatible?

    Yes, it works across languages and platforms.

    https://grpc.io/

    Best regards,

    Maher

    Wednesday, September 4, 2019 6:04 PM
  • User475983607 posted

    Is gRPC on the client side cross-platform compatible? I have started reading your link, but haven't gotten to an answer. From a comparative, it looks like a better solution for my application than simple http.

    I would not call Web API simple HTTP...

    Anyway see the following.

    https://code.tutsplus.com/tutorials/rest-vs-grpc-battle-of-the-apis--cms-30711

    Keep in mind that Web API operates over HTTP/2 as well.

    Wednesday, September 4, 2019 6:55 PM
  • User1289604957 posted

    .NET Core 3.0 Preview 9 includes the new gRPC client API. Find out how to call gRPC services with it here:

    https://docs.microsoft.com/en-us/aspnet/core/grpc/client?view=aspnetcore-3.0

    Best regards,

    Maher

    Thursday, September 5, 2019 9:03 AM
  • User1456895836 posted

    NET Standard is not a replacement for a PCL, but part of the framework that it should be built on. Per this latest documentation:

    .NET Standard versioning is important for usage. Given a .NET Standard version, you can use libraries that target that same or lower version. The following approach describes the workflow for using .NET Standard PCLs, specific to .NET Standard targeting.

    Select a .NET Standard version to use for your PCL. Use libraries that depend on the same .NET Standard version or lower.

    Thursday, September 5, 2019 10:16 AM
  • User1456895836 posted

    Looking at the Xamarin site, it appears that gRPC is not Xamarin cross-platform compatible yet; a documentation search finds no hits. Just one forum question which is not answered.

    Thursday, September 5, 2019 10:37 AM
  • User1289604957 posted
    .NET Standard 1.0 1.1 1.2 1.3 1.4 1.5 1.6 2.0 2.1
    Preview
    .NET Core 1.0 1.0 1.0 1.0 1.0 1.0 1.0 2.0 3.0
    .NET Framework <sup>1</sup> 4.5 4.5 4.5.1 4.6 4.6.1 4.6.1 <sup>2</sup> 4.6.1 <sup>2</sup> 4.6.1 <sup>2</sup> N/A<sup>3</sup>
    Mono 4.6 4.6 4.6 4.6 4.6 4.6 4.6 5.4 6.4
    Xamarin.iOS 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.14 12.16
    Xamarin.Mac 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.8 5.16
    Xamarin.Android 7.0 7.0 7.0 7.0 7.0 7.0 7.0 8.0 10.0
    Universal Windows Platform 10.0 10.0 10.0 10.0 10.0 10.0.16299 10.0.16299 10.0.16299 TBD
    Unity 2018.1 2018.1 2018.1 2018.1 2018.1 2018.1 2018.1 2018.1 TBD

    Best regards,

    Maher

    Thursday, September 5, 2019 11:57 AM
  • Thursday, September 5, 2019 12:00 PM
  • User1456895836 posted

    To migrate to the latest pre-release gRPC version in NuGet, it requires .NET Standard 2.1 which is not in NuGet. Where can it be found?  

    Friday, September 6, 2019 7:21 PM
  • User1289604957 posted

    To migrate to the latest pre-release gRPC version in NuGet, it requires .NET Standard 2.1 which is not in NuGet. Where can it be found?  

    https://www.nuget.org/packages/Grpc.AspNetCore.Server

    https://github.com/grpc/grpc-dotnet/releases/tag/v2.23.0

    Best regards,

    Maher

    Friday, September 6, 2019 7:38 PM
  • User1456895836 posted

    I was referring to Xamarin app; to install Grpc.Net.Client,, NuGet is requiring  .NET Standard 2.1 already be installed.

    Friday, September 6, 2019 7:48 PM
  • User1289604957 posted

    Ok so you are using this NuGet package:

    https://www.nuget.org/packages/Grpc.Net.Client/0.2.23-pre2

     Would you please the <g class="gr_ gr_205 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" id="205" data-gr-id="205">csproj</g> file of your project that is/will reference(ing) Grpc.Net.Client?

    Best regards,

    Maher

    Friday, September 6, 2019 8:01 PM
  • User1456895836 posted
    <Project Sdk="Microsoft.NET.Sdk">
    
      <PropertyGroup>
        <TargetFramework>netstandard2.0</TargetFramework>
        <ProduceReferenceAssembly>true</ProduceReferenceAssembly>
      </PropertyGroup>
    
      <ItemGroup>
        <PackageReference Include="Xamarin.Forms" Version="4.2.0.709249" />  
        <PackageReference Include="Xamarin.Essentials" Version="1.3.0" />
      </ItemGroup>
    </Project>

    It is a brand new project using VS 2019 v2 preview targeting a Xamarin Mobile App.

    Friday, September 6, 2019 9:14 PM
  • User1289604957 posted

    Thank you for sharing your <g class="gr_ gr_10 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" id="10" data-gr-id="10">csproj</g> file. This is how you target the .NET Standard 2.1 which is a specification and not a NuGet package to download :

    <Project Sdk="Microsoft.NET.Sdk">
    
      <PropertyGroup>
        <TargetFramework>netstandard2.1</TargetFramework>
        <ProduceReferenceAssembly>true</ProduceReferenceAssembly>
      </PropertyGroup>
    
      <ItemGroup>
        <PackageReference Include="Xamarin.Forms" Version="4.2.0.709249" />  
        <PackageReference Include="Xamarin.Essentials" Version="1.3.0" />
      </ItemGroup>
    </Project>

    Then you can add the Grpc.Net.Client NuGet <g class="gr_ gr_9 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="9" data-gr-id="9">packge</g>.

    Best regards,

    Maher

    Friday, September 6, 2019 9:23 PM
  • User1456895836 posted

    Changing the shared project resulted in the UWP project not being compatible with .NET Standard 2.1, even with the Project min/max UAP set to the highest available version 10.0.18362.0.

    I unloaded the project, built successfully the shared, Android and iOS projects and now plan to move forward, awaiting the next UWP pre-release or release when available.

    Saturday, September 7, 2019 1:44 AM
  • User1289604957 posted

    Yes, currently the UWP is not compatible yet with .NET Standard 2.1 as <g class="gr_ gr_151 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="151" data-gr-id="151">precised</g> in the <g class="gr_ gr_152 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="152" data-gr-id="152">compatilibity</g> matrix.

    Best regards,

    Maher

    Saturday, September 7, 2019 8:52 AM