简体   繁体   English

C#Visual Studio 2010表单应用程序错误消息

[英]C# Visual Studio 2010 form application error message

I keep getting this error when starting a new form project in Visual Studio C# 2010. I think I may have renamed a file from within the properties manager, but not sure! 在Visual Studio C#2010中启动新表单项目时,我一直收到此错误。我想我可能已经在属性管理器中重命名了一个文件,但不确定!

The designer could not be shown for this file because none of the classes within it can be designed. 无法为此文件显示设计器,因为其中的所有类都无法设计。 The designer inspected the following classes in the file: Form1 --- The base class 'System.Object' cannot be designed. 设计者检查了文件中的以下类:Form1 ---无法设计基类“System.Object”。

How can I solve this problem? 我怎么解决这个问题?

Warnings also include: 警告还包括:

Warning 1 The designer could not be shown for this file because none of the classes within it can be designed. 警告1无法为此文件显示设计器,因为其中的任何类都无法设计。 The designer inspected the following classes in the file: 设计者检查了文件中的以下类:

Form1 --- The base class 'System.Object' cannot be designed. Form1 ---无法设计基类'System.Object'。 0 0 0 0

Delete the designer file. 删除设计器文件。 Right-click on the aspx file and choose Convert to Web Application . 右键单击aspx文件,然后选择“ 转换为Web应用程序” That should recreate your designer file properly and allow you to open the page again. 这应该正确地重新创建您的设计器文件,并允许您再次打开页面。

我通过将.net 4.0客户端配置文件的属性更改为.net 4.0配置文件来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM