Learn business growth with Google Analytics 4 Forums Google Analytics 4 Trouble integrating Google Analytics 4 .NET client library in a .NET framework 4.7.2 project

  • Trouble integrating Google Analytics 4 .NET client library in a .NET framework 4.7.2 project

    Posted by Henry on 16 November 2022 at 6:12 pm

    So, I’m trying to use NuGet to install the Google.Analytics.Data.V1Beta package but it’s been a no-go, it’s not installing.

    I’m getting this: “Install failed. Rolling back… Could not install package ‘Grpc.Net.Client 2.46.0’. The package is meant to go into a project that targets ‘.NETFramework, Version=v4.7.2’, but the package isn’t compatible with that framework. Need info? Contact the package author.”

    Looks like there’s a dependency in there that’s not playing nice with .Net Framework.

    But when I check out this: https://www.nuget.org/packages/Google.Analytics.Data.V1Beta#supportedframeworks-body-tab,
    it shows that Google.Analytics.Data.V1Beta should be compatible with net462 and beyond.

    Has anyone had any luck installing the .Net client library for a .Net Framework 4.7.2 project?

    Jose replied 1 year, 4 months ago 3 Members · 2 Replies
  • 2 Replies
  • Lucas

    Member
    23 March 2023 at 6:27 am

    The issue you’re facing might be due to the limited support for gRPC over HTTP/2 by the .NET Framework. You can overcome this issue by configuring the channel to use WinHttpHandler. The links provided will direct you to pages that dive deeper into how gRPC is used in the .NET framework. The specifics may vary, but underlying it all is the fact that .NET Framework can work well with gRPC over HTTP/2 once you’ve got your channel set up with WinHttpHandler. It’s definitely a bridgeable gap!

  • Jose

    Member
    30 March 2023 at 8:21 am

    The issue you’re encountering while installing the “Google.Analytics.Data.V1Beta” package using NuGet is likely not related to the .NET Framework version. Although you’re using .NET Framework 4.7.2 and the package is supposed to be compatible with net462 and beyond, the installation issue seems to be caused by the version of Visual Studio you’re using. I have personally experienced a similar issue in Visual Studio 2015, but the package installed successfully in other versions like Visual Studio 2017, 2019, and 2022. Hence, I suggest trying to install the package on a later version of Visual Studio.

Log in to reply.