当前上下文App.xaml.cs中不存在名称“InitializeComponent” [英] The name 'InitializeComponent' does not exist in the current context App.xaml.cs

查看:105
本文介绍了当前上下文App.xaml.cs中不存在名称“InitializeComponent”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Silverlight / Expression Blend 3的新手。我已经创建了一个示例项目,但是当我尝试构建它时,我得到错误'名称'InitializeComponent'不存在于当前背景' 错误引用的文件是"App.xaml.cs"。  任何帮助将不胜感激。
谢谢

Hi,
I'm very new to Silverlight/Expression Blend 3. I've created a sample project but when I try to build it I get the error 'The name 'InitializeComponent' does not exist in the current context'  The file the error refers to is 'App.xaml.cs'.   Any assistance would be appreciated.
Thanks

推荐答案

     这可能是因为App.xaml中的x:Class属性与App.xaml.cs中的类名不匹配。请按照以下步骤告诉我们是否适合您。

1。打开App.xaml并检查x:Class属性(例如:SilverlightApplication101.App)
2。打开App.xaml.cs并检查命名空间和类名是否匹配(命名空间:SilverlightApplication101,class:App),如果没有修复它。
3。建造

不应该建造好。

谢谢,
Navit Saxena
Hi,
      This is probably because the x:Class attribute in App.xaml doesn't match the class name in App.xaml.cs. Please follow these steps and let us know if it works for you.

1. Open App.xaml and check x:Class attribute (Ex: SilverlightApplication101.App)
2. Open App.xaml.cs and check if the namespace and class name match (namespace: SilverlightApplication101, class: App), if not fix it.
3. Build

Not it should build fine.

Thanks,
Navit Saxena


这篇关于当前上下文App.xaml.cs中不存在名称“InitializeComponent”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆