question

cartellonegerardo avatar image
cartellonegerardo asked

How to setup vscode with the playfab sdk?

I'm following this tutorial:

https://docs.microsoft.com/en-us/gaming/playfab/features/automation/cloudscript-af/quickstart#playfabfunctioncontext

so in vs code with the azure plugin when I click "run build tasks to update this list" i keep on getting errors because dependencies are missing. I tried just putting the playfab sdk folder in the project https://github.com/PlayFab/CSharpSDK

here is what my files look like

I get a two mile long line of errors which start by these clearly i'm doing something wrong in setting this up:

\PlayFabServerScipts.csproj]
C:\Users\Carte\Source\Repos\MostAnnoyingChat\PlayFabServerScipts\PlayfabCSharpSDK\XamarinTestRunner\XamarinTestRunner\PlayFabSDK\PlayFabClientAPI.cs(4489,69): error CS0111: Type 'PlayFabClientAPI' already defines a member called 'WritePlayerEventAsync' with the same parameter types [C:\Users\Carte\Source\Repos\MostAnnoyingChat\PlayFabServerScipts\PlayFabServerScipts.csproj]
C:\Users\Carte\Source\Repos\MostAnnoyingChat\PlayFabServerScipts\PlayfabCSharpSDK\XamarinTestRunner\XamarinTestRunner\PlayFabSDK\PlayFabClientAPI.cs(4516,69): error CS0111: Type 'PlayFabClientAPI' already defines a member called 'WriteTitleEventAsync' with the same parameter types [C:\Users\Carte\Source\Repos\MostAnnoyingChat\PlayFabServerScipts\PlayFabServerScipts.csproj]
C:\Users\Carte\Source\Repos\MostAnnoyingChat\PlayFabServerScipts\PlayfabCSharpSDK\PlayFabSDK\source\PlayFabServerModels.cs(2969,20): error CS0229: Ambiguity between 'Unordered.SortProperty' and 'Unordered.SortProperty' [C:\Users\Carte\Source\Repos\MostAnnoyingChat\PlayFabServerScipts\PlayFabServerScipts.csproj]
C:\Users\Carte\Source\Repos\MostAnnoyingChat\PlayFabServerScipts\PlayfabCSharpSDK\PlayFabSDK\source\PlayFabServerModels.cs(2969,10): error CS0121: The call is ambiguous between the following methods or properties: 'Unordered.Unordered()' and 'Unordered.Unordered()' [C:\Users\Carte\Source\Repos\MostAnnoyingChat\PlayFabServerScipts\PlayFabServerScipts.csproj]

before this I had managed just fine to follow this tutorial:

https://docs.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-csharp?pivots=programming-language-csharp&tabs=in-process

but it didn't require the playfab sdk so it does seem like my current issue mainly concerns the playfab sdk in vscode. I took the non unity sdk since trying to make a cloudscript project within a unity project posed many issues. such as multiple .csproj files.

Any help will be highly appreciated.

CloudScript
vspic.png (15.0 KiB)
vspicproj.png (22.6 KiB)
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

·
Made Wang avatar image
Made Wang answered

Did you use dotnet add package PlayFabAllSDK to import PlayFabSDK according to the documentation? If so, you don't need to import PlayFabCSharpSDK manually, they are conflicting in content.

2 comments
10 |1200

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

cartellonegerardo avatar image cartellonegerardo commented ·

no I had not, I didn't know about that, now I deleted the old files and I just used "dotnet add package" and everything works just fine thanks a lot.

In the mean time though i noticed there was a second way to upload cloud scripts, using the revision system you can find here developer.playfab.com -> titleId -> automation -> cloud-script -> revisions.

I noticed It uses javascript instead of c# but asides from that Is there any reason to use one of the systems over the other?

0 Likes 0 ·
Made Wang avatar image Made Wang cartellonegerardo commented ·

The second way is the legacy version of Cloud Script, if you haven't used it, it is not recommended to start with it. We recommend using Azure Function Cloud Script, which is more comprehensive and performs better.

1 Like 1 ·

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.