【问题标题】:Moving App.xaml from a Windows 8 Store app project folder从 Windows 8 应用商店应用项目文件夹中移动 App.xaml
【发布时间】:2013-01-09 17:19:30
【问题描述】:

我正在开发一个 Windows 8 应用商店应用项目 (C#)。

应用程序项目文件位于根文件夹中,每个受支持平台的特定文件都放置在其自己的文件夹中:

 ROOT  
  |-- Application.Windows8.csproj  
  |-- Application.OtherPlatform.csproj
  |--
  |-- Windows8
          |-- App.xaml
          |-- Other Win8 related files

我的 Windows8 项目包括 Windows8 文件夹下的所有文件,包括 App.xaml。

在尝试使用此结构时,我在构建项目时遇到错误:

应用程序主文件必须命名为 App.xaml

是否可以将 App.xaml 保存在与 csproj 文件不同的文件夹中?

更新:

我在 MS Connect 上打开了一张票,因为文档从未指定此文件必须位于根文件夹中:http://connect.microsoft.com/VisualStudio/feedback/details/776168/windows-8-store-app-project-doesnt-compile-if-app-xaml-is-placed-in-a-subfolder

【问题讨论】:

  • 我在开发 Windows 商店应用程序时注意到另一件事,如果您尝试将 Windows 商店应用程序项目的入口点从 App.xaml 更改为新的 xaml 文件,让我们在 Package 中说“MainApp.xaml” .appxmanifest 文件即使这样它也会给出相同的错误“应用程序主文件必须命名为 App.xaml”。我将“MainApp.xaml”的属性窗口中的构建操作属性更改为“ApplicationDefiition”,即使它没有帮助。 App.xaml 是无法更改的 Windows 商店应用程序的硬编码入口点。虽然几乎没有必要这样做,但很高兴知道事实。

标签: c# .net wpf xaml windows-8


【解决方案1】:

由于 Windows Store 应用程序的限制,这是不可能的。

来自MSDN -> Application class

注意应用程序主文件必须命名为 App.xaml。

普通的 WPF 应用程序没有这样的限制。

【讨论】:

  • 文件名为 app.xaml。它在哪里说它需要驻留在项目的根文件夹中?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-12-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-01
  • 2016-03-31
  • 1970-01-01
相关资源
最近更新 更多