在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. 使用OpenCV画折线图

    使用OpenCV画直方图是一件轻松的事情,画折线图就没有那么Easy了,还是使用一个库吧: GraphUtils 源代码添加入工程 原文链接:http://www.360doc.com/content ...

  2. C# 带Cookies发送请求

    #region --来自黄聪 void F1() { #region --创建cookies容器 添加Cookies和对应的URl(Hots主) CookieContainer cc = new Co ...

  3. 将 GNOME 默认的界面切换动画功能关闭

    gsettings set org.gnome.desktop.interface enable-animations false

  4. TCP协议的三次握手、四次挥手

    TCP三次握手 TCP的连接的建立需要发送三个包,一次称为三次握手(Three-way Handshake). 三次握手的目的是连接服务器指定端口,建立TCP连接,并同步连接双方的序列号和确认号并交换 ...

  5. day8 面向对象编程基础

    活在当下的程序员应该都听过“面向对象编程”一词,也经常有人问能不能用一句话解释下什么是“面向对象编程”,我们先来看看比较正式的说法. 把一组数据结构和处理它们的方法组成对象(object),把相同行为 ...

  6. dmidecode输出详解

    一.先来看几个用dmidecode查看内存信息的例子. 1.查看内存槽数.那个槽位插了内存,大小是多少 [root@jiangyi01.sqa.zmf /home/ahao.mah] #dmideco ...

  7. 20.基于es内部_version进行乐观锁并发控制

  8. Golang - 开篇必须吹牛逼

    目录 Golang - 开篇必须吹牛逼 Go牛逼吗 安装环境 Golang - 开篇必须吹牛逼 (1)我们为什么要学 高并发 深度 || 广度 (2)go学习思路和目标 多打多练 掌握go语言 做一个 ...

  9. Bootstrap关于表单(二):水平表单

    Bootstrap框架默认的表单是垂直显示风格,但很多时候我们需要的水平表单风格(标签居左,表单控件居右) 在Bootstrap框架中要实现水平表单效果,必须满足以下两个条件: 1.在<form ...

  10. 优化 RequireJS 项目(合并与压缩) 【已翻译100%】

    英文原文:Optimize (Concatenate and Minify) RequireJS Projects 标签: RequireJS Node.js 参与翻译 (1人) : 裴宝亮 本文将演 ...