So I had been using this Windows SDK for Facebook to make an Unity Plugins and using in my game.
But when I build into Visual project then run it on my Device it show this error , and I have no idea what does it mean , so does anyone know why this error appear .
The full error stack is :
TypeLoadException: Requested Windows Runtime type ‘Facebook.FBSession’ is not registered.
at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD)
at Facebook.FBSession.get_ActiveSession()
at WPUniversalFB.WPFacebook.Init(String fbAppId, String winAppId)
at SocialFacebookWP.Initialize(Action callback)
at SocialMgr.Initialize(Action callback, SocialType type)
at StartSceneController.OnLoginCommand(DataTable data)
at StartSceneController.OnMessage(DataTable data)
at MessageDistributionLayer.OnMessage.Invoke(DataTable message)
at MessageDistributionLayer.Dispath(DataTable message)
at MessageDistributionLayer.d__2.MoveNext()
at UnityEngine.Internal.$MethodUtility.$Invoke21070(Int64 instance, Int64* args)
at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method)
Exception: Error in the DLL (Exception from HRESULT: 0x800401F9 (CO_E_ERRORINDLL))
Type: System.Runtime.InteropServices.COMException
Module: mscorlib
InnerException:
AdditionalInfo:
at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD)
at Facebook.FBSession.get_ActiveSession()
at WPUniversalFB.WPFacebook.Init(String fbAppId, String winAppId)
at SocialFacebookWP.Initialize(Action callback)
at SocialMgr.Initialize(Action callback, SocialType type)
at StartSceneController.OnLoginCommand(DataTable data)
at StartSceneController.OnMessage(DataTable data)
at MessageDistributionLayer.OnMessage.Invoke(DataTable message)
at MessageDistributionLayer.Dispath(DataTable message)
at MessageDistributionLayer.d__2.MoveNext()
at UnityEngine.Internal.$MethodUtility.$Invoke21070(Int64 instance, Int64* args)
at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method)
I faced this problem in another C# project that I was working on.
My problem was because the build (publish) configuration that I was using were removing all unused assemblies.
I guess that you can try to remove this option and if solve your problem, please let me know.