question

Dhiraj avatar image
Dhiraj asked

Getting error in setting up first API call (Visual Studio)

I tried to set up my very first visual studio solution for PlayFab as per the steps followed in this article:- 

https://docs.microsoft.com/en-us/gaming/playfab/sdks/c-sharp/quickstart

But I keep getting the following error whenever I try to add the NuGet package:-

Failed to add reference to 'System.Runtime'. Please make sure it is in the Global Assembly Cache.


The code and the steps are exactly as specified in the article. Any idea how to get rid of this message? Adding any other non playfab package works smoothly.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Andy avatar image
Andy answered

What version of Visual Studio are you using and can you confirm that you have version 4.5 of the .Net framework installed? You might also want to try explicitly adding a reference to System.Runtime to your project and building it prior to installing the PlayFab package. That should populate the cache with the needed assembly.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dhiraj avatar image Dhiraj commented ·

Hi Andy :)

I am using Visual Studio 2015 Enterprise edition. I can't upgrade Visual Studio itself to newer versions since there is something that I need to use that will not work with newer versions (unrelated to PlayFab). But if I check 'Target Framework' of my project it shows 4.5.1 , I also tried changing to 4.5 after reading your message to see if that will make it work, but the same issue. Also tried changing to 4.6.1 from the drop down and then trying to install the package but keep getting the same error. So yes I do have 4.5 of .Net framework installed.

Regarding the second suggestion of yours, I will try and see if it works.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.