2016-04-16 62 views
0

我目前正在爲我爲xbox工作的遊戲收到此錯誤。它運行得非常好,認爲unity5,當我將它作爲pc的.exe遊戲導出時,我無法將它運行到本地或遠程運行。我已經設置爲調試x64,因爲它就是說它需要運行一個xbox。如何修復xbox的appxmanifest.xml?


OUTPUT CODE 

    Restoring NuGet packages... 
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages during build.' 
1>------ Build started: Project: Assembly-CSharp, Configuration: Debug x64 ------ 
2>------ Build started: Project: Assembly-CSharp-firstpass, Configuration: Debug x64 ------ 
2> Assembly-CSharp-firstpass -> C:\Users\david\Desktop\Speed Runner\UWP\Assembly-CSharp-firstpass\bin\x64\Debug\Assembly-CSharp-firstpass.dll 
1> Assembly-CSharp -> C:\Users\david\Desktop\Speed Runner\UWP\Assembly-CSharp\bin\x64\Debug\Assembly-CSharp.dll 
3>------ Build started: Project: Speed Runner, Configuration: Debug x64 ------ 
3> UnityInstallationDir "C:\Program Files\Unity\Editor". 
3> UnityWSAPlayerDir "C:\Program Files\Unity\Editor\Data\PlaybackEngines\MetroSupport". 
3> UnityProjectDir "C:\Users\david\Desktop\Speed Runner". 
3> Copying unprocessed assemblies... 
3> Running AssemblyConverter... 
3> AssemblyConverter done. 
3> Speed Runner -> C:\Users\david\Desktop\test games\speed runner\Speed Runner\bin\x64\Debug\Speed Runner.exe 
3> Running Code Analysis... 
3>MSBUILD : warning CA1707: Microsoft.Naming : Remove the underscores from namespace name 'Speed_Runner'. 
3>MSBUILD : warning CA2210: Microsoft.Design : Sign 'Speed Runner.exe' with a strong name key. 
3>MSBUILD : warning CA1014: Microsoft.Design : Mark 'Speed Runner.exe' with CLSCompliant(true) because it exposes externally visible types. 
3>MSBUILD : warning CA1001: Microsoft.Design : Implement IDisposable on 'App' because it creates members of the following IDisposable types: 'AppCallbacks'. If 'App' has previously shipped, adding new members that implement IDisposable to this type is considered a breaking change to existing consumers. 
3>C:\Users\david\Desktop\test games\speed runner\Speed Runner\App.xaml.cs(56): warning CA1305: Microsoft.Globalization : Because the behavior of 'string.Format(string, object)' could vary based on the current user's locale settings, replace this call in 'App.OnActivated(IActivatedEventArgs)' with a call to 'string.Format(IFormatProvider, string, params object[])'. If the result of 'string.Format(IFormatProvider, string, params object[])' will be displayed to the user, specify System.Globalization.CultureInfo.CurrentCulture as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify System.Globalization.CultureInfo.InvariantCulture. 
3>C:\Users\david\Desktop\test games\speed runner\Speed Runner\App.xaml.cs(51): warning CA1062: Microsoft.Design : In externally visible method 'App.OnActivated(IActivatedEventArgs)', validate parameter 'args' before using it. 
3>C:\Users\david\Desktop\test games\speed runner\Speed Runner\App.xaml.cs(71): warning CA1062: Microsoft.Design : In externally visible method 'App.OnFileActivated(FileActivatedEventArgs)', validate parameter 'args' before using it. 
3>C:\Users\david\Desktop\test games\speed runner\Speed Runner\App.xaml.cs(92): warning CA1062: Microsoft.Design : In externally visible method 'App.OnLaunched(LaunchActivatedEventArgs)', validate parameter 'args' before using it. 
3>MSBUILD : warning CA1051: Microsoft.Design : Because field 'App.splashScreen' is visible outside of its declaring type, change its accessibility to private and add a property, with the same accessibility as the field has currently, to provide access to it. 
3>C:\Users\david\Desktop\test games\speed runner\Speed Runner\MainPage.xaml.cs(140): warning CA1024: Microsoft.Design : Change 'MainPage.GetSwapChainPanel()' to a property if appropriate. 
3>C:\Users\david\Desktop\test games\speed runner\Speed Runner\MainPage.xaml.cs(73): warning CA1062: Microsoft.Design : In externally visible method 'MainPage.OnNavigatedTo(NavigationEventArgs)', validate parameter 'e' before using it. 
3> Code Analysis Complete -- 0 error(s), 11 warning(s) 
3>C:\Users\david\Desktop\test games\speed runner\Speed Runner\bin\x64\Debug\AppxManifest.xml : error APPX0501: Validation error. error C00CE169: App manifest validation error: The app manifest must be valid as per schema: Line 37, Column 20, Reason: 'windows.fileTypeAssociation' violates enumeration constraint of 'windows.backgroundTasks windows.preInstalledConfigTask windows.updateTask windows.restrictedLaunch'. The attribute 'Category' with value 'windows.fileTypeAssociation' failed to parse. 
========== Build: 2 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== 
========== Deploy: 0 succeeded, 0 failed, 0 skipped ========== 

ERROR CODE 

    Severity Code Description Project File Line Suppression State 
Error  Validation error. error C00CE169: App manifest validation error: The app manifest must be valid as per schema: Line 37, Column 20, Reason: 'windows.fileTypeAssociation' violates enumeration constraint of 'windows.backgroundTasks windows.preInstalledConfigTask windows.updateTask windows.restrictedLaunch'. The attribute 'Category' with value 'windows.fileTypeAssociation' failed to parse. Speed Runner C:\Users\david\Desktop\test games\speed runner\Speed Runner\bin\x64\Debug\AppxManifest.xml  

AppManifest.xml 

    <?xml version="1.0" encoding="utf-8"?> 
<Package xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp build" xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:build="http://schemas.microsoft.com/developer/appx/2015/build"> 
    <!-- 
    THIS PACKAGE MANIFEST FILE IS GENERATED BY THE BUILD PROCESS. 

    Changes to this file will be lost when it is regenerated. To correct errors in this file, edit the source .appxmanifest file. 

    For more information on package manifest files, see http://go.microsoft.com/fwlink/?LinkID=241727 
    --> 
    <Identity Name="SpeedRunner" Publisher="CN=osbodav gaming" Version="1.0.0.0" ProcessorArchitecture="x64" /> 
    <mp:PhoneIdentity PhoneProductId="bb-2006-4704-91d6-aad428b34a24" PhonePublisherId="00000000-0000-0000-0000-000000000000" /> 
    <Properties> 
    <DisplayName>Speed Runner</DisplayName> 
    <PublisherDisplayName>osbodav gaming</PublisherDisplayName> 
    <Logo>Assets\StoreLogo.scale-100.png</Logo> 
    </Properties> 
    <Dependencies> 
    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10240.0" MaxVersionTested="10.0.14295.0" /> 
    <PackageDependency Name="Microsoft.VCLibs.140.00" MinVersion="14.0.23816.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" /> 
    </Dependencies> 
    <Resources> 
    <Resource Language="EN-US" /> 
    </Resources> 
    <Applications> 
    <Application Id="App" Executable="Speed Runner.exe" EntryPoint="SpeedRunner.App"> 
     <uap:VisualElements DisplayName="Speed Runner" Square150x150Logo="Assets\Square150x150Logo.scale-200.png" Square44x44Logo="Assets\Square44x44Logo.scale-200.png" Description="Speed Runner" BackgroundColor="transparent"> 
     <uap:DefaultTile ShortName="Speed Runner" Wide310x150Logo="Assets\Wide310x150Logo.scale-200.png" /> 
     <uap:SplashScreen Image="Assets\SplashScreen.scale-200.png" BackgroundColor="#222C37" /> 
     <uap:InitialRotationPreference> 
      <uap:Rotation Preference="landscape" /> 
      <uap:Rotation Preference="landscapeFlipped" /> 
      <uap:Rotation Preference="portrait" /> 
      <uap:Rotation Preference="portraitFlipped" /> 
     </uap:InitialRotationPreference> 
     </uap:VisualElements> 
     <Extensions> 
     <Extension Category="windows.fileTypeAssociation"> 
      <FileTypeAssociation Name="game" /> 
     </Extension> 
     </Extensions> 
    </Application> 
    </Applications> 
    <Extensions> 
    <Extension Category="windows.activatableClass.inProcessServer"> 
     <InProcessServer> 
     <Path>UnityEngineDelegates.dll</Path> 
     <ActivatableClass ActivatableClassId="UnityEngineDelegates.PlatformInvoke" ThreadingModel="both" /> 
     <ActivatableClass ActivatableClassId="UnityEngineDelegates.FunctionDefsDictionary" ThreadingModel="both" /> 
     </InProcessServer> 
    </Extension> 
    <Extension Category="windows.activatableClass.inProcessServer"> 
     <InProcessServer> 
     <Path>UnityPlayer.dll</Path> 
     <ActivatableClass ActivatableClassId="UnityPlayer.XamlPageAutomationPeer" ThreadingModel="both" /> 
     <ActivatableClass ActivatableClassId="UnityPlayer.AppCallbacks" ThreadingModel="both" /> 
     </InProcessServer> 
    </Extension> 
    <Extension Category="windows.activatableClass.inProcessServer"> 
     <InProcessServer> 
     <Path>CLRHost.dll</Path> 
     <ActivatableClass ActivatableClassId="WinRTBridge.MethodTools" ThreadingModel="both" /> 
     <ActivatableClass ActivatableClassId="WinRTBridge.WinRTBridge" ThreadingModel="both" /> 
     <ActivatableClass ActivatableClassId="WinRTBridge.Marshalling" ThreadingModel="both" /> 
     <ActivatableClass ActivatableClassId="WinRTBridge.GCHandles" ThreadingModel="both" /> 
     <ActivatableClass ActivatableClassId="WinRTBridge.ExceptionHandling" ThreadingModel="both" /> 
     <ActivatableClass ActivatableClassId="WinRTBridge.Utils" ThreadingModel="both" /> 
     <ActivatableClass ActivatableClassId="WinRTBridge.UnityEngineObjectTools" ThreadingModel="both" /> 
     <ActivatableClass ActivatableClassId="WinRTBridge.ArrayTools" ThreadingModel="both" /> 
     <ActivatableClass ActivatableClassId="WinRTBridge.GCHandledObjects" ThreadingModel="both" /> 
     <ActivatableClass ActivatableClassId="WinRTBridge.ScriptingPinnedArray" ThreadingModel="both" /> 
     <ActivatableClass ActivatableClassId="WinRTBridge.TypeInformation" ThreadingModel="both" /> 
     <ActivatableClass ActivatableClassId="WinRTBridge.ObjectInstantiation" ThreadingModel="both" /> 
     </InProcessServer> 
    </Extension> 
    </Extensions> 
    <build:Metadata> 
    <build:Item Name="TargetFrameworkMoniker" Value=".NETCore,Version=v5.0" /> 
    <build:Item Name="VisualStudio" Version="14.0" /> 
    <build:Item Name="VisualStudioEdition" Value="Microsoft Visual Studio Community 2015" /> 
    <build:Item Name="OperatingSystem" Version="10.0.10586.0 (th2_release.151029-1700)" /> 
    <build:Item Name="Microsoft.Build.AppxPackage.dll" Version="14.0.25123.0" /> 
    <build:Item Name="ProjectGUID" Value="{13A45C13-3265-47B8-BC48-A553B569DF55}" /> 
    <build:Item Name="ilc.exe" Version="1.2.23413.00 built by: PROJECTNREL" /> 
    <build:Item Name="OptimizingToolset" Value="ilc.exe" /> 
    <build:Item Name="UseDotNetNativeSharedAssemblyFrameworkPackage" Value="true" /> 
    <build:Item Name="Microsoft.Windows.UI.Xaml.Build.Tasks.dll" Version="14.0.25123.0" /> 
    <build:Item Name="WindowsMobile" Version="10.0.14295.0" /> 
    </build:Metadata> 
</Package> 

回答

2

的錯誤信息是很清楚這裏:'windows.fileTypeAssociation' violates enumeration constraint of 'windows.backgroundTasks windows.preInstalledConfigTask windows.updateTask windows.restrictedLaunch'. The attribute 'Category' with value 'windows.fileTypeAssociation' failed to parse.

這意味着有一個名爲Category具有價值windows.fileTypeAssociation這個值的屬性不是其中之一允許的值。這裏只有一個在你的清單元素有這樣的屬性:

<Extension Category="windows.fileTypeAssociation"> 
    <FileTypeAssociation Name="game" /> 
</Extension> 

錯誤消息基本上是說這個元素在清單中不是允許的。您的問題,最明顯的解決辦法是從AppManifest.xml文件中刪除這個元素,但文件本身會發出警告,這將不起作用:

THIS PACKAGE MANIFEST FILE IS GENERATED BY THE BUILD PROCESS. 

Changes to this file will be lost when it is regenerated. To correct errors in this file, edit the source .appxmanifest file. 

所以,你需要修改文件與.appxmanifest擴展AppManifest.xml是從...生成的。它可能被命名爲package.appxmanifest

+0

感謝您的幫助,不知道該文件甚至在那裏 –