Проект на Visual C# Express
От: MMikhail  
Дата: 01.03.06 05:25
Оценка:
Открываю проект на Visual C# Express и при по попытке открыть дизайнер форм он мне пишет

 One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes. 

The class Form1 can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again. 
Hide     

at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)


Это что значит ?
... << RSDN@Home 1.1.4 stable SR1 rev. 568>>
Re: Проект на Visual C# Express
От: FunnyRabbit Россия  
Дата: 01.03.06 06:19
Оценка: 3 (1)
Здравствуйте, MMikhail, Вы писали:

MM>Открываю проект на Visual C# Express и при по попытке открыть дизайнер форм он мне пишет


MM>
MM> One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes. 

MM>The class Form1 can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again. 
MM>Hide     

MM>at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager)
MM>at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
MM>at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
MM>at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host) 

MM>


MM>Это что значит ?


Это значит, что тебе класс с формой надо поместить первым в файле, а только после него размещать остальные классы.
Т.е. подобное
.....
.....
namespace SomeSpace
{
class SomeClass
{
.....
.....
}

class SomeForm : System.Windows.Forms.Form
{
......
......
}
}

заменить на
.....
.....
namespace SomeSpace
{
class SomeForm : System.Windows.Forms.Form
{
......
......
}

class SomeClass
{
.....
.....
}
}

Правда спецификация и реализация могут быть разделены (partial). Поэтому позырь в обоих файлах(YourForm.cs, YourForm.Designer.cs или как там его).
То что меня не убивает, делает меня умнее.
Re[2]: Проект на Visual C# Express
От: MMikhail  
Дата: 01.03.06 06:27
Оценка:
Здравствуйте, FunnyRabbit, Вы писали:

FR>Это значит, что тебе класс с формой надо поместить первым в файле, а только после него размещать остальные классы.


Помогло !!!! Спасибо. Странно а раньше такого не замечал
... << RSDN@Home 1.1.4 stable SR1 rev. 568>>
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.