I was hoping the latest patch would fix the build errors I’m getting for UWP, but it hasn’t. My project builds fine for PC, but I’m seeing the following:
Assets\Scripts\LevelFileBrowser.cs(62,61): error CS1061: ‘DateTime’ does not contain a definition for ‘ToShortDateString’ and no extension method ‘ToShortDateString’ accepting a first argument of type ‘DateTime’ could be found (are you missing a using directive or an assembly reference?)
Assets\Xbox Live\Scripts\UserProfile.cs(148,49): error CS0234: The type or namespace name ‘UserPicker’ does not exist in the namespace ‘Windows.System’ (are you missing an assembly reference?)
I expected there might be some issues with the Xbox Live package, but the first error makes no sense.
It doesn’t matter which scripting runtime I use, both 3.5 and 4.6 throw it. I’ve made sure to flip the DLLs for the Xbox Live piece when I change between them, so it shouldn’t be that. I’m using .NET backend, not IL2CPP.
DateTime.ToShortDateString is not available on UWP on .NET scripting backend - so that explains the first error.
Can you share your code around the second error? Did you wrap it in #ifdefs so it doesn’t get compiled in the editor? Which Windows SDK are you targeting in build settings? That class got added in 10.0.14393.
So I removed and re-added the package, flipped back to .NET 3.5 and I’m getting a ton of errors now
Assets/Xbox Live/Scripts/UnityTaskExtensions.cs(5,24): error CS0234: The type or namespace name Tasks' does not exist in the namespace System.Threading’. Are you missing an assembly reference?
Assets/Xbox Live/Scripts/UserProfile.cs(9,24): error CS0234: The type or namespace name Tasks' does not exist in the namespace System.Threading’. Are you missing an assembly reference?
Assets/Xbox Live/Scripts/Leaderboard.cs(71,13): error CS0012: The type System.Object' is defined in an assembly that is not referenced. Consider adding a reference to assembly System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’
Assets/Xbox Live/Scripts/Leaderboard.cs(81,13): error CS0012: The type System.Collections.Generic.IEnumerable1<Microsoft.Xbox.Services.Social.Manager.XboxSocialUser>’ is defined in an assembly that is not referenced. Consider adding a reference to assembly System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Assets/Xbox Live/Scripts/Leaderboard.cs(81,13): error CS0012: The type System.Collections.IEnumerable’ is defined in an assembly that is not referenced. Consider adding a reference to assembly System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Assets/Xbox Live/Scripts/UnityTaskExtensions.cs(11,57): error CS0246: The type or namespace name Task’ could not be found. Are you missing an assembly reference?
Assets/Xbox Live/Scripts/UnityTaskExtensions.cs(21,75): error CS0246: The type or namespace name Task' could not be found. Are you missing an assembly reference? Assets/Xbox Live/Scripts/UnityTaskExtensions.cs(40,33): error CS0246: The type or namespace name Task’ could not be found. Are you missing an assembly reference?
Assets/Xbox Live/Scripts/UnityTaskExtensions.cs(60,12): error CS0246: The type or namespace name Task' could not be found. Are you missing an assembly reference? Assets/Xbox Live/Scripts/UnityTaskExtensions.cs(87,33): error CS0246: The type or namespace name Task’ could not be found. Are you missing an assembly reference?
Assets/Xbox Live/Scripts/UnityTaskExtensions.cs(91,16): error CS0246: The type or namespace name Task' could not be found. Are you missing an assembly reference? Assets/Xbox Live/Scripts/UserProfile.cs(102,64): error CS0012: The type System.EventArgs’ is defined in an assembly that is not referenced. Consider adding a reference to assembly `System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’
This is all in the Xbox Live package, not my code. I’ve seen posts about this, but it was usually when the person was using .NET 4.6. I’ve made sure the requisite DLLs are set correctly.
This might be irrelevant but I have actually dealt with a very similar issue for a while and yours looks almost identical. Did you create a new “Tasks” class? I have done that before and I started getting tons of errors because the compiler was getting confused between the Task I created vs the Task that was part of unity and other extensions