在Visual Studio中创建Windows Store项目,在MainPage.xaml.cs中出现错误:

  • The name ‘InitialzeComponent’ does not exist in the current context

这个问题的出现通常会有两个方面的原因:

  1. 最常见的是MainPage.xaml中的x:Class与类名不一致。确认x:Class是正确的类和命名空间。
  2. 另一种情况就是,MainPage.xaml的Build Action没有设置为‘Page’。

删掉obj文件夹重新编译也可能解决问题。

=============================================

我的解决方案:

将MainPage.xaml的Build Action设置为‘ApplicationDefinition’,然后改回‘Page’。

参考资料:http://stackoverflow.com/questions/17853898/the-name-initializecomponent-does-not-exist-in-the-current-context-cannot-get

The name ‘InitialzeComponent’ does not exist in the current context的更多相关文章

  1. CS0103: The name ‘Scripts’ does not exist in the current context解决方法

    转至:http://blchen.com/cs0103-the-name-scripts-does-not-exist-in-the-current-context-solution/ 更新:这个bu ...

  2. The name 'Scripts' does not exist in the current context error in MVC

    创建完成ASP.NET MVC4应用程序以后,试着运行其中一个Create页面, 程序报出运行是错误: CS0103: The name 'Scripts' does not exist in  th ...

  3. .ascx.g.cs文件不能生成 The name ‘InitializeControl’ does not exist in the current context - Visual Web part Sharepoint

    InitializeControl doesn't exsit When using visual studio 2012 for developing SharePoint 2013 Visual ...

  4. MVC:The name 'Scripts' does not exist in the current context

    汇总:http://www.cnblogs.com/dunitian/p/4523006.html#efmvc 解决:在View下面的Web.Config的namespaces添加 <add n ...

  5. vs 编译错误 The name 'InitializeComponent' does not exist in the current context in WPF application

    1:文件命名空间的问题 xaml文件和model.cs文件的命名空间 2:csproj 那么它究竟是给谁用的呢?那是给开发工具用的,例如我们在熟悉不过的Visual Studio,以及大家可以没有接触 ...

  6. 【转】关于编写WPF UserControl时提示The name 'InitializeComponent' does not exist in the current contextr的解决!

    1.打开.csproj(工程)文件. 2.找到<Import Project="$(MSBuildBinPath)/Microsoft.CSharp.targets" /&g ...

  7. [译]:Xamarin.Android开发入门——Hello,Android快速上手

    返回索引目录 原文链接:Hello, Android_Quickstart. 译文链接:Xamarin.Android开发入门--Hello,Android快速上手 本部分介绍利用Xamarin开发A ...

  8. .NET跨平台:在Linux Ubuntu上编译coreclr/corefx/dnx(20150617)

    编译时间:北京2015年6月17日上午 操作系统:Ubuntu 14.04.2 LTS Mono版本:Mono JIT compiler version 4.3.0 (master/3445ac5 T ...

  9. What's New in C# 6.0

    Static Types as using So, we are all quite familiar with this notion of accessing static class membe ...

随机推荐

  1. 2016年8月17日 内省(1)18_黑马程序员_使用beanUtils操纵javabean

    8.内省(1):18_黑马程序员_使用beanUtils操纵javabean 1.导入两个包: 2.调用静态方法. 9.泛型 map.entrySet() :取出map集合的键值对组成一个set集合. ...

  2. REST ful

    前后端分离.面向资源.无状态: 请求包含全部信息. 什么是 REST? 下面六条准则定义了一个 REST 系统的特征: 客户-服务器(Client-Server),提供服务的服务器和使用服务的客户需要 ...

  3. js 验证文件格式和大小

    <script> $('#btnSearch').click(function(){ // alert("000");// fileElem = document.ge ...

  4. js 二级联动

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  5. POST请求成功,但接口返回数据不正确

    事件:使用Jmeter做APP的搜索接口测试,请求成功了,但无论keyword是什么“内容”(这里的内容是带引号的哦),接口返回的内容都是:未匹配到搜索结果 排查问题: keyword=“世界” st ...

  6. 【转载】解决方案:git@github.com出现Permission denied (publickey)

    遇到的问题 今天心血来潮,想将intellij上的项目代码放到GitHub上管理. 在进行添加远程库的时候,出现了:git@github.com出现Permission denied (publick ...

  7. PAT_A1138#Postorder Traversal

    Source: PAT A1138 Postorder Traversal (25 分) Description: Suppose that all the keys in a binary tree ...

  8. mongodb分片集群开启安全认证

    原文地址:https://blog.csdn.net/uncle_david/article/details/78713551 对于搭建好的mongodb副本集加分片集群,为了安全,启动安全认证,使用 ...

  9. PHP利用Mysql锁解决高并发

    前面写过利用文件锁来处理高并发的问题的,现在我们说另外一个处理方式,利用Mysql的锁来解决高并发的问题 先看没有利用事务的时候并发的后果 创建库存管理表 CREATE TABLE `storage` ...

  10. 论vue项目api相关代码的组织方式

    论vue项目api相关代码的组织方式 看了下项目组同事的代码,发现不同项目有不同的组织版本 版本一: ├─apis │ a.api.js │ b.api.js │ b.api.js │ d.api.j ...