Warning: Do not update to Windows SDK 10.0.10586.0 just yet

Hello,

Microsoft has released a new Windows 10 SDK yesterday (version 10.0.10586.0):

http://blogs.msdn.com/b/chuckw/archive/2015/11/30/windows-10-sdk-november-2015.aspx

There was a bug uncovered in Unity recently where it fails to read Windows 10 SDK version correctly if this new SDK is installed. Due to this bug, Unity will generate incorrect project files when targeting Windows Store with Windows 10 SDK, which Visual Studio will not be able to open.

We’re going to release a patch to fix this bug, but until we do, please do not download and install this SDK if you wish to build for Windows 10. I’ll notify in this thread when the fix is released.

The older Windows 10 SDK which works with Unity (version 10.0.10240.0) can be downloaded here:

UPDATE: Fix is now available in 5.2.3p3 and 5.3.1f1 releases.

4 Likes

.< bummer… I updated yesterday and yep, I’m not able to open new builds… missing object reference from the csproj file.

is there a workaround(s) that I can edit into the project .csproj file? Seems like a lot of namespace errors happening causing it…

[edit]

nvm… looks like via VS installer I can revert to 10.0.10240.0 (i’ll give that a try)

Yes. You can manually fix “TargetPlatformVersion” XML field of .csproj file to be “10.0.10586.0” rather than “10.0.10586.0.0”.

1 Like

@Tautvydas-Zilys Do you mean "“10.0.10586.0” rather than “10.0.10240.0.0"” :smile: in your previous statement?

So to confirm, it’s possible to simply fix manually then?

via Visual Studio 2015 Installer, I was able to remove 10.0.10586.0 (10.0.10240.0 was still available), and unfortunately now Unity is unable to compile as it continues to look for 10.0.10586.0 :

  • Finished compile Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll
    Compilation failed because the compiler couldn’t be executed!

(Filename: Line: 57396624)

DisplayProgressNotification: Build Failed
Error building Player because scripts had compiler errors

… I’ll re-apply 10.0.10586.0 and do the .csproj edit to see if that allows me to atleast do the exports from Unity and builds in Visual Studio.

No, my post is correct. Unity adds an extra “.0” to the version number. Visual studio gets confused, chaos ensues.

The workaround is possible, but it’s ugly. You’ll have to do it each time you build from Unity if you use C# projects and you’ll also have to do it each time you build to a new location.

Thanks for the clarification @Tautvydas-Zilys Easy to miss that distinction.

ok, after much ‘to-do’ … replacing 10586 with 10240 ‘and’ updating the references in the project for “Windows Mobile Extensions for UWP…” allows the project to open and build in Visual Studio (of course using older SDK)

otherwise, updating to 10.0.10586.0 and removing just the extra .0 I get the following:

The project requires a platform SDK (UAP, Version=10.0.10586.0) that is not installed.

which of course it is installed :smile:

This fixed most of my project for me. Combined with this line which also had an extra zero I was able to build.
<SDKReference Include="WindowsMobile, Version=10.0.10586.0.0">Changed to

<SDKReference Include="WindowsMobile, Version=10.0.10586.0">

I experience the same thing. Uninstalling Win 10 SDK 10.0.10586.0 does not allow me to build. Unity still looks for that version number.

Reinstalling latest Win 10 SDK and making some edits to the .csproj file allowed me to build.

I see patch #2 just release, is this problem fixed or we need wait new patch?

The fix is not in today’s patch.

Hey guys, I wrote a quick fix. This script should be put in an Editor folder to prevent build errors. I put mine in Assets/Editor/Win10SdkFix.cs

Code is here:

/* Garth: The Windows 10 SDK was updated recently, which broke Unity builds.
* It came down to a few extra ".0" in an XML file someplace.
* Instead of manually changing it, let's just code Unity to do it for us.
*/

#if UNITY_WSA
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.IO;

public class Win10SdkFix
{
    [PostProcessBuild(1)]
    public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
    {
        string name = PlayerSettings.productName;
        string pathToXml = pathToBuiltProject + "/" + name + "/" + name + ".csproj";
        Debug.Log("Attempting to fix bad SDK version at " + pathToXml);
        if (!File.Exists(pathToXml))
        {
            Debug.Log("Could not find " + name + ".csproj file to fix.");
            return;
        }
        string xml = File.ReadAllText(pathToXml);
        if (!xml.Contains(BadString))
        {
            Debug.LogWarning("Could not find bad string in " + name + ".csproj file. Have you updated Unity? You can remove this script.");
        }
        else
        {
            xml = xml.Replace(BadString, GoodString);
            File.WriteAllText(pathToXml, xml);
            Debug.Log("Fixed sdk version string in " + name + ".csproj file.");
        }
    }

    const string BadString = "10.0.10586.0.0";
    const string GoodString = "10.0.10586.0";
}
#endif
8 Likes

Great work @GarthSmith Could probably enhance that by also testing the buildtarget, so it’s only evaluated for the Win10 builds. Presently it will fire for all platforms.

It’s wrapped in #if UNITY_WSA so that class doesn’t even exist for other platforms. =p

Ahh, didn’t spot that. Thanks for the clarification :smile:

What bad luck. Just lost 3 hours due to this :cry: glad to know there is a potential fix on its way. Thanks for the script Garth, seems to have made a difference :slight_smile:

1 Like

Do I need to be on the latest major upgraded version Windows 10 for this SDK?

My attempts to upgrade to that major upgrade version failed due to a driver installation problem during the upgrade process at 23%

I don’t think so - I actually installed it on build 10240 (Windows 10 v1).

1 Like

Update:

Fix is now available in 5.2.3p3 release. The fix is not in 5.3.0f4 - it will be included in 5.3.0p1 next week.

1 Like