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

Xamarin.Forms android can not resolve reference: System.Diagnostics.PerformanceCounter, referenced by StackExchange.Redis #1442

Closed
tomasfabian opened this issue Apr 22, 2020 · 12 comments

Comments

@tomasfabian
Copy link

Hi,
I have a Xamarin.Forms.Droid build problem:

Severity Code Description Project File Line Suppression State
Error Can not resolve reference: System.Diagnostics.PerformanceCounter, referenced by StackExchange.Redis. Please add a NuGet package or assembly reference for System.Diagnostics.PerformanceCounter, or remove the reference to StackExchange.Redis. Xamarin.Sample.Android

I also tried to include System.Diagnostics.PerformanceCounter package:

    <PackageReference Include="StackExchange.Redis">
      <Version>2.1.30</Version>
    </PackageReference>
    <PackageReference Include="System.Diagnostics.PerformanceCounter">
      <Version>4.7.0</Version>
    </PackageReference>

Is it possible to use StackExchange.Redis with Xamarin.Forms apps?

Thank you, Tomas

@Filipowicz251
Copy link

Filipowicz251 commented May 13, 2020

I have the same issue. Adding NuGet package doesn't solve anything

[UPDATE]

Most probably this is correlated with nuget package reference and this bug especially: dotnet/android#2674

Going back to packages.config fix the issue (i just read it - i will right now try it;) )

@andrev121
Copy link

I have the same issue. Adding NuGet package doesn't solve anything

[UPDATE]

Most probably this is correlated with nuget package reference and this bug especially: xamarin/xamarin-android#2674

Going back to packages.config fix the issue (i just read it - i will right now try it;) )

Tried install both of packages in shared and droid projects. Placed packages.config with reference on PerfomanceCounter in root of droid project. Nothing worked. How to fix this issue? Does redis unusable with forms?

SouJack added a commit to SouJack/StackExchange.Redis that referenced this issue Mar 10, 2021
@SouJack
Copy link

SouJack commented Mar 10, 2021

See pullrequest #1702

@SHuygh
Copy link

SHuygh commented Mar 29, 2021

@mgravell Would it be possible to remove the reference to the performance counter based on @SouJack PR for MonoAndroid10 and Xamarin.iOS10 (cfr. https://docs.microsoft.com/nl-be/xamarin/cross-platform/app-fundamentals/nuget-manual) to be able to use these within Xamarin Forms and Xamarin Native projects.

@mgravell
Copy link
Collaborator

mgravell commented Mar 29, 2021 via email

@SHuygh
Copy link

SHuygh commented Mar 30, 2021

MonoAndroid10 and Xamarin.iOS10 are the TFM targeting Android 1.0 + and IOS 1.0+ (e.g. AzureAD also uses multi targeting to remove a certain part of the API for Android and IOS)
I hope this help.

@AmmarSaleh45
Copy link

Any update on this issue please, Is it possible to use StackExchange.Redis with Xamarin.Forms apps?

@mgravell
Copy link
Collaborator

mgravell commented Apr 4, 2021 via email

@SriramSakthivel
Copy link

I'm also looking to use StackExchange.Redis with Xamarin.Forms app. Any update on this one please?

@NickCraver
Copy link
Collaborator

I'm looking at TFMs since adding net6.0 here for other reasons. I'm not sure what the landscape looks like though - if we added a build for net6.0-ios and net6.0-android...would that work for people in having a build without this dependency/functionality?

@NickCraver
Copy link
Collaborator

Can anyone here chime in on if such TFMs would be useful? If so we could add and conditional the reference but it adds maintenance so I'd like to see if we're actually solving a problem still :)

@NickCraver
Copy link
Collaborator

I'm going to close this out since there doesn't seem to be a current need. If the above new TFMs do help someone I'm wide open to adding them, but with no responses I'm reading that this isn't a current issue or at least a pressing one at not worth adding.

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

No branches or pull requests

9 participants