question

BCI Team avatar image
BCI Team asked

playFab namespace can't be found,I have an issue with playfab namespace (error CS0246) it says the type or namespace name "PlayFab" can't be found.

The issue started suddenly because it was working perfectly fine before I don't understand what changed. All my Playfab methods are underlined in red because at the top of my code when I write using PlayFab and using PlayFab.ClientModels, it says the type or namespace "PlayFab" can't be found. Also, I have this message in visual studio saying "This unity project was not generated for the visual studio tools for unity. In your unity editor select visual studio for a better experience". But that is already selected from before and I didn't change anything I even went to double-check and it's still selected. I don't understand what is happening.

Thank you for your help.

,
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

·
Rick Chen avatar image
Rick Chen answered

As the error message indicate, the issue could be that the Unity is not properly configured to use the Visual Studio version that you are using. You can follow this tutorial to troubleshoot: Get started with Visual Studio and Unity. This issue is not likely caused by PlayFab, if you have any further question, you can contact the Visual Studio team or Unity team for help.

3 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.

BCI Team avatar image BCI Team commented ·

The issue is that I followed that tutorial when I started using unity and playfab and everything was working fine until one day it stopped but I didn't change anything.

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ BCI Team commented ·

You could try to clean the caches, update/reinstall Unity Engine and Visual Studio, remove any files that can cause this issue, check the external tools option in Unity, change the External Script Editor to something else then change back and see if it works. Since your entire Unity project is not connecting to the Visual Studio, it is not likely to be an issue of PlayFab. If you still encounter issue after trying solutions above, please contact the Visual Studio team or Unity team for help.

0 Likes 0 ·
JayZuo avatar image JayZuo ♦ BCI Team commented ·

Typically, clean the caches and "Regenerate project files" in Unity Preferences → External Tools will resolve this isseu.

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.