Back to Writing
NOTESplayfabcsharpunityandroidasync

PlayFab — Using C# SDK Instead of Unity SDK in VS Code (Part 2: DLL Setup)

May 21, 2021Updated Feb 17, 2026

![](

0eY-DzhbwvLSS6OjwMg.Sc-3_7AxzLk4G182uCEv5h2-OhrsDX19SOuDH1QAykQg.PNG.cdw0424/image.png?type=w966)

When using PlayFab in Unity, you'd typically use the Unity SDK as shown above.

However, if you want task-based asynchronous design, you need to use the C# SDK.

So in this post, I'll walk you through how to use the PlayFab C# SDK in Unity.

First, you need to download the C# SDK. Download the PlayFabAllSDK NuGet package.

As mentioned in the previous post, change the file extension to .7z and extract the archive.

Go to lib -> net45 -> extract the "PlayFabAllSDK.dll" file and move it to your desktop.

Now open Unity, create a "Plugins" folder under the Assets folder, and place the file you just extracted there.

After placing the file, let's change some settings.

I'll be writing this assuming the platform is Android, but the process is largely the same for Windows, so feel free to follow along.

After switching platforms, click Player Settings.

Under Other Settings > Configuration, set the Scripting Backend and Api Compatibility Level to "IL2CPP" and ".NET 4.x" respectively.

Now if you write PlayFab code in your scripts, it should work properly.

You can confirm it works correctly in the Editor.

You can verify the registration was successful in PlayFab.

But here's the problem: it doesn't work when you build for Android.

The serializer isn't working properly, so there's one more thing we need to do.

Open VS Code and create a new file called "link.xml" under the Assets folder.

<linker>
<assembly fullname="PlayFabAllSDK">
<type fullname="*" preserve="all"/>
</assembly>
</linker>

Enter the xml content as shown above. Then build again.

You should be able to confirm it works without any issues.

That wraps up this post. I hope this was helpful for PlayFab users looking for task-based async design.

References

2023-06-13 Update

Editor version used: Unity 2022.3.1f LTS

PlayFab C# SDK version: 1.154

When using version 1.154, use the Dotnet Standard 2.0 plugin and set Dotnet Standard 2.1 in Unity.

Additionally, the Polly package is required, so you'll need to include it as well.