Problems Building for Windows Store, UnauthorizedAccessException WinRTLegacy.dll

I have been following Develop Microsoft HoloLens Apps Now, and I have setup a simple scene to test on the HoloLens. When I try to build it, however, I always get the error:

UnauthorizedAccessException: Access to the path “Temp\StagingArea\Data\Managed\WinRTLegacy.dll” is denied.
System.IO.File.Delete (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:179)
System.IO.Directory.RecursiveDelete (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:195)
System.IO.Directory.Delete (System.String path, Boolean recursive) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:205)
Utility.DeleteDirectory (System.String path) (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/Utility.cs:322)
PostProcessWinRT.MoveDataManagedToRoot () (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:463)
PostProcessWinRT.Process () (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:125)
UnityEditor.WSA.BuildPostprocessor.PostProcess (BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:155)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.BuildReporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:186)
UnityEditor.HostView:OnGUI()

My build settings are
2964941--220130--upload_2017-2-18_18-2-46.png

And I have set the player settings to fastest and virtual reality supported to windows holographic.

Which Unity version are you on? Any chance you have some anti virus software running that’s scanning those files as unity puts them there, thus preventing unity from deleting them?

I think I am using 5.5.1f. I am running Windows 10 without any extra antivirus, but I wouldn’t know if Windows defender would behave as such. I will try disabling it and trying again.

I think the issue resolved itself, maybe from restarting my computer or something.