Hi,
I am trying to port our Xbox One game to Windows Store, and I have downloaded the Windows 10 SDK, the Xbox Live SDK and necessary tools and add-ons for Unity. I have gotten my game to build out from Unity and the solution to build in Visual Studio and the game runs.
I am trying to add Xbox Live functionality now though and I am following the Xbox Live SDK documentation but I cant seem to install the necessary NuGet Packages though when I try to install the Microsoft.Xbox.Live.SDK.WinRT.UWP NuGet Package as it just gives me the following error when I try to install it inside the NuGet Packet Manager inside Visual Studio:
Severity Code Description Project File Line Suppression State
Error Unable to load package âMicrosoft.Xbox.Live.SDK.WinRT.UWP.Netcore.Releaseâ. 0
Please any help on the matter would be immensely appreciated.
Donât add that nuget package through VS. Instead, extract it with 7-zip (or other unzipping software) and put the .winmd and .dll files into your Unity project. Unity will then correctly configure the resulting VS project to use that package.
1 Like
Thanks so much for the heads up, really appreciate it.
Ok, cool it seems to work now. However, I seem to get an error now which halts the game completely. The error is concerned with the SignIn process and gets triggered in the XboxLive script I created to handle my gameâs specific XboxLive functionality. This error gets thrown as soon as the SignIn() method gets called in my XboxLive script:
Unhandled exception at 0x00007FFC11E5D1B4 (twinapi.appcore.dll) in nVerloreVerstand.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x0000000EB25FE170, 0x0000000000000001).
This is what the SignIn() method looks like:
async void SignIn()
{
SignInResult result = await m_user.SignInAsync(UIDispatcher);
if (result.Status == SignInStatus.Success)
{
m_xboxLiveContext = new Microsoft.Xbox.Services.XboxLiveContext(m_user);
debugText += "\n User signed in: " + m_xboxLiveContext.User.Gamertag;
}
}
I am using the example script that is included in the Xbox Live SDK documents under the section âHow to add Xbox Live support to a Unity UWP projectâ, I still need to modify it towards my gameâs specific needs but I just want to get the basics running properly first.
Ive followed all of the steps detailed in the documents how to connect everything, but something seems to wrong or missing, Im just not sure what though.
Is xboxservices.config file copied to the output directory correctly? IIRC lack of that file causes the exception youâre seeing.
I copied it to the root Output folder that Unity builds out to (where the main project sln file is located), is there perhaps a specific place it needs to be placed in?
What I do indeed notice is that when I open the xboxservices.config file I get the following errors inside of it:
Severity Code Description Project File Line Suppression State
Error XML document must contain a root level element. Miscellaneous Files F:\VerloreBackup\UWP\Mind\Build\nVerloreVerstand\xboxservices.config 5
Severity Code Description Project File Line Suppression State
Error Invalid token âTextâ at root level of document. Miscellaneous Files F:\VerloreBackup\UWP\Mind\Build\nVerloreVerstand\xboxservices.config 1
I followed the Documentation step by step to enter the details and just have my TitleId and Primary ServiceConfigId set:
{
âTitleIdâ : My Title ID Here,
âPrimaryServiceConfigIdâ : âMy PrimaryServiceConfigId Hereâ
}
Did you add it to the project itself? VS does not automatically scan for files in the folder.
Not sure if this problem is 100% the same as what I faced but I found that the nuget package didnât actually work.
I installed it but then faced similar errors when trying to sign in. In the end I tried adding the Xbox live projects directly as project references (the documentation has steps to do this).
After doing this then the exact same login code worked fine.
Ok I managed to solve the errors inside xboxservices.config (it was saved as an XML Configuration not a JSON file).
However this didnt fix the issue though.
@Tautvydas-Zilys Yes I just noticed that the xboxservices.config does get included in the project itself (I added it by dragging it into VS and placing it under the Main UWP app (not under the ROOT solution or the CSharp Assembly or the firstpass). I moved the one located in the ROOT build folder outside of the entire project to avoid confusion. Yet the problem still persists. When the solution get built and deployed it is copied to the UWP appâs folder.
@matt33315 I tried adding the references directly to the UWP app but when I try to add either of the .vcxproj files, I just get an error window saying that the file reference could not be added due to it either not being accessible or not being a valid Assembly or COM component.
Can you attach the contents of the main UWP app project files (.vcxproj if you use IL2CPP, .csproj if you use .NET scripting backend)?
In that file properties, you need to make sure that the type is set to âContentâ and copy is set to âCopy If Newerâ.
I have attached the .csproj file.
I have set the File Properties so that the type reflects Content and the copy is set to Copy If Newer, however this doesnt seem to make a difference. I couldnt set any properties directly on the .csproj file there is a Child titled Properties and under that there are items located, AssemblyInfo.cs and Default.rd.xml, and I set them both to Content and Copy If Newer.
I also tried adding the source objects directly (instead of references) by dragging them in under the UWP app as I did with xboxservices.config and I also tried to include them in the Unity project and build out the project with them included, but neither of these attempts seemed to solve the issue either.
3093668â233421ânVerloreVerstand.zip (3.51 KB)
I am attaching some screenshots as well to show you what the UWP app contents look like in Visual Studio.
I also managed to install the Nuget to the project in the Nuget Manager by installing an older version, I noticed that the XboxLiveSDK that I have downloaded from GDNP isnt the latest version, Im not sure if this might have something to do with the issues Im having. Ever since installing the Nuget package (UWP.WinRT one) It seems to get stuck at a different error now before even reaching the SignIn process.
The error occurs in the XboxLiveUser() method located in SafeTypes.g.cs and is connected with the Microsoft.Xbox.Services.System.XboxLiveUser class. Here is the error:
Unhandled exception at 0x00007FFB5984D5B8 (ucrtbase.dll) in nVerloreVerstand.exe: An invalid parameter was passed to a function that considers invalid parameters fatal.
And here is the code that triggers the error:
this.__AttachAndRelease(retval);
Ok I changed the xboxservices file to only be a .config, although the issue still remains.
As for point 1. Im not sure how to add xboxservices as a reference, I keep getting this same error window saying that the file reference could not be added due to it either not being accessible or not being a valid Assembly or COM component when I try to use âAdd Referenceâ.
I ended up just dragging it into VS under the UWP app as a child, I am attaching a picture to help demonstrate.
Im not sure if there is a specific way to reference the xboxservices.config file.
Put this snippet inside your .csproj file under any :
<Content Include="xboxservices.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Ok awesome! That fixed it. Thanks so much!
I seem to have a little trouble signing in, though. I am getting the following error when trying to Sign-In:
âWe are unable to sign you in to Xbox Live at the moment. Try again in a while.â
With the following error code: 0x87DD0005
I am using a Dev Account that I created in XDP and still used for Xbox One development. I have my PC set to my assigned .0 Sandbox (Im not sure if my assigned .99 Sandbox might be a better option though). My Dev account region is set up for USA I think and my PC is set to my local country (South Africa) so Im not sure if that might have an effect.
Either way it seems to be connected to the account itself not the coding.
I can see that my Dev account does indeed sign in, its when I hit âLetâs Playâ that I get the above error.
Ok I seem to get a few thousand errors out of the blue now when trying to build in Visual Studio, I didnt change anything so Im not sure where these issues are coming from it must be from Unity itself though as it persists even after deleting the build and rebuilding from Unity. Im attaching a picture that shows some of the errors although they all seem to be related.
âŚdid you update your Visual Studio recently?
Not that I know of. I had to redo the whole process as I accidentally to deleted the whole process I then got stuck at the first SignIn error again and then after a few more builds I started getting this error. The only thing that I installed/updated for Visual Studio was the NuGet package that I installed via the Nuget Manager as I couldnt get the project to run and wasnt sure if it was the Xbox Live Nuget that needs to be updated.