首页 > 解决方案 > Visual Studio, Android: Find out, which Framework is neccessary for Nuget-packages

问题描述

I am in bit of a tumble here. I am wanting to move away from admob. I read the Facebook Ads SDK is just "as" good, if not better.

So, for that I am working with Visual Studio, I need to download the SDK via the Nuget-console. But as soon as I am trying install the Facebook SDK Version 6.0.10. it gives me the error that (translated from german):

"The package "Facebook 6.0.10" could not be installed. You are trying to install this package into a project, that references "MonoAndroid, Version = v8.0". The Package however does not include any assembly reference or data that would be compatable with this framework."

I am however able to install the Facebook Version JUST before that (5.4.1) but I need the newer one.

What's also weired is the fact, that I am running the newest and second newest frameworks and tried both but nothing from the 6+ range of Facebook SDKs will install.

However, my question: How can I find out, which framework is neccissary in order to install any nuget package? I cannot download and try them all, that would be insane - there must be a better way, right?

Thanks!

标签: androidvisual-studionuget

解决方案


How can I find out, which framework is necessary in order to install any nuget package? I cannot download and try them all, that would be insane - there must be a better way, right?

To find out which framework is necessary when installing any nuget package, The only way I know is to look inside the NuGet package itself.

I use the NuGet Package Explorer to see the framework it supports, you can get it from Microsoft store.

For example, I downloaded the package Facebook 6.0.10 from nuget.org manually and open it with nuget package explorer:

enter image description here

Then we could to know the package Facebook 6.0.10 supports:

  - net35-client (.NETFramework,Version=v3.5,Profile=Client)
  - net40-client (.NETFramework,Version=v4.0,Profile=Client)
  - net45 (.NETFramework,Version=v4.5)
  - sl4-wp71 (Silverlight,Version=v4.0,Profile=WindowsPhone71)
  - sl5 (Silverlight,Version=v5.0)
  - winrt (WinRT,Version=v0.0)

That is the reason why you got the error "The package "Facebook 6.0.10" could not be installed. You are trying to install this package into a project, that references "MonoAndroid, Version = v8.0", MonoAndroid, Version = v8.0 is not in the support list for the package Facebook 6.0.10.

Hope this helps.


推荐阅读