1、打开.csproj(工程)文件。

2、找到<Import Project="$(MSBuildBinPath)/Microsoft.CSharp.targets" />这一行

3、在这一行下面添加<Import Project="$(MSBuildBinPath)/Microsoft.WinFX.targets" />

4、保存文件。

 这时就可以编译通过了。

原文地址:http://blog.csdn.net/xiaoling9/article/details/1821305

【转】关于编写WPF UserControl时提示The name 'InitializeComponent' does not exist in the current contextr的解决!的更多相关文章

  1. WPF编译时提示“...不包含适合于入口点的静态‘Main’方法 ...”

    今天看了一下wpf的Application类方面的知识,一个windows应用程序由一个Application类的实例表示,该类跟踪在应用程序中打开的所有窗口,决定何时关闭应用程序(属性 Shutdo ...

  2. WPF编译时提示"xxx不包含适合于入口点的静态 Main方法xxx"

    WPF编译时提示"xxx不包含适合于入口点的静态 Main方法xxx"生成的时候一直报"xxx不包含适合于入口点的静态 Main 方法xxx" 看到这个问题首先 ...

  3. eclipse 编写scala代码时提示computing additional info

    window->proference,把方框中那两个选项去掉不选,保存即可(或者只选择scala completions(java sources)),(只不过这么做之后就没有代码提示了)遇到这 ...

  4. 《OpenGL编程指南第七版》学习——编译时提示“error C2381: “exit” : 重定义;__declspec(noreturn) 不同”错误的解决办法

    解决办法一. #if defined(_WIN32) # ifndef GLUT_BUILDING_LIBextern _CRTIMP void __cdecl exit(int); 上面是glut. ...

  5. Xshell连接linux(deepin)时提示ssh服务器拒绝了密码,请再试一次解决方法

    用Xshell root连接时显示ssh服务器拒绝了密码,应该是应该是sshd的设置不允许root用户用密码远程登录 修改 /etc/ssh/sshd_config文件,注意,安装了openssh才会 ...

  6. 在Eclipse IDE进行Struts开发时提示错误:java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher的解决办法

    If you have... included all necessary jars Configured build path correctly added them all in deploym ...

  7. 安装mysql时提示The host 'xxx' could not be looked up with resolveip的解决办法

    1.首先用cat查看/etc/hosts文件,会显示以下内容: 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.loca ...

  8. 连接mysql数据库时提示2003 can't connect to MySQL server on ip(10060)的解决办法

    今天部署 JavaWeb 项目到云服务器,突然出现can t connect to MySQL server on ip的问题 经过了一些检查,认为很有可能是防火墙的原因.下面是检查的具体操作: 因为 ...

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

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

随机推荐

  1. BackTrack5(BT5)各版本下载

    BT5R3(最新版本)http://www.nigesb.com/backtrack-5-r3-released.html  BT5R2KDE版32位: http://ftp.halifax.rwth ...

  2. k8s-创建自定义chart及部署efk-二十五

    一.chart的结构 (1)更改helm为阿里云仓库源 [root@master helm]# helm repo remove stable "stable" has been ...

  3. kubernetes1.13.1部署ingress-nginx-十一

    一.Ingress 简介 (1) 在Kubernetes中,服务和Pod的IP地址仅可以在集群网络内部使用,对于集群外的应用是不可见的. 为了使外部的应用能够访问集群内的服务, 在Kubernetes ...

  4. Unity网格合并_材质合并[转]

    http://blog.csdn.net/chenggong2dm/article/details/41699029

  5. Spring Cloud Alibaba基础教程:Sentinel Dashboard中修改规则同步到Nacos

    上一篇我们介绍了如何通过改造Sentinel Dashboard来实现修改规则之后自动同步到Apollo.下面通过这篇,详细介绍当使用Nacos作为配置中心之后,如何实现Sentinel Dashbo ...

  6. iOS Button选中与取消

    /** * 是否点击 */ @property (nonatomic ,assign) BOOL selected; /** *  button 点击事件选中取消选中 */ - (void)handl ...

  7. python __builtins__ help类 (32)

    32.'help', 接收对象作为参数,更详细地返回该对象的所有属性和方法 class _Helper(builtins.object) | Define the builtin 'help'. | ...

  8. sql mysql和sqlserver存在就更新,不存在就插入的写法(转)

    转自:http://hi.baidu.com/tidy0608/item/ff930fe2436f2601560f1dd9 sqlsever数据存在就更新,不存在就插入的两种方法 两种经常使用的方法: ...

  9. KMP算法笔记(云笔记图片版)

  10. Educational Codeforces Round 18 D

    Description T is a complete binary tree consisting of n vertices. It means that exactly one vertex i ...