c# - 创建 Windows 应用商店应用程序时出现问题。 (Windows 8)

标签 c# microsoft-metro visual-studio-2012 windows-store-apps

当我在 Visual Studio 中创建一个新的空白应用程序 (XAML) 项目时,出现以下错误:

某些引用文献的开头不正确。在新的解决方案中真的应该这样吗? (还没写东西) 如果我尝试在此时构建,我会得到:

Cannot resolve Windows Metadata

所以我想我会解决 namespace 问题。 这是通过添加对 Window 的引用并添加命名空间 Windows.UI.XAML 实现的; 之后我遇到了超过 3000 (3136) 个错误,这里是其中的一些错误:

  • The .winmd file 'Windows.winmd' contains type 'Windows.Globalization.ILanguageStatics'. The use of the Windows namespace is reserved.
  • The .winmd file 'Windows.winmd' contains type 'Windows.Globalization.ICalendarFactory'. The use of the Windows namespace is reserved.
  • The .winmd file 'Windows.winmd' contains type 'Windows.Globalization.IGeographicRegion'. The use of the Windows namespace is reserved.
  • The .winmd file 'Windows.winmd' contains type 'Windows.Globalization.DayOfWeek'. The use of the Windows namespace is reserved.
  • etc.

到目前为止我尝试了什么

  • 修复 Visual Studio
  • 修复 SDK'
  • 卸载/重新安装 SDK'

' Windows Software Development Kit (SDK) for Windows 8

我还应该补充一点,我已经将我的 Windows 7 升级到 Windows 8。

有人对如何解决这个问题有任何建议吗?

最佳答案

我刚刚在 VS 2012 Update 2 中遇到了这个问题。输出中还有一个警告,类似于“无法找到‘Windows.winmd’文件的实现细节”(我没有保存此文本,所以不记得确切的拼写。这个警告​​指向某个项目 Debug 文件夹中的 Windows.winmd。我发现这个文件夹实际上包含这个文件的副本。显然,VS 出于某种原因制作了这个副本。删除后我能够再次构建我的项目。

因此,请在重新安装 SDK、VS 或 Windows 8 之前阅读所有警告

关于c# - 创建 Windows 应用商店应用程序时出现问题。 (Windows 8),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12779293/

相关文章:

c# - csvhelper 一切都写在 Excel 的一栏中

c# - 对 C# Web 服务的静态引用

html - css metro 瓷砖选择的风格

c# - GameTime.ElapsedGameTime 没有改变

c# - 使用 Workflow 的 ASP.net 页面导航

sqlite - 错误 175 : The specified store provider cannot be found in the configuration, 或无效。 SQLite

c# - 承载错误 - invalid_token - 找不到签名 key

c# - 使用 Prism、MVVM、Unity 查看切换导航

c# - 为 Windows 应用商店应用获取 .mp3 文件中的 Albumart

visual-studio - 在构建项目时将内容文件输出到特定文件夹