C# Project corrupted?
-
Hi, Sorry, If I have posted this query to a wrong group! I'm facing an issue with C# project. I use VS 2005 express edition. I was developing a C# project and had couple of UI controls that I had placed using UI editor. Everything was fine but now I can't view the "UI designer" now. If I run the project I do get the UI that I had designed but cant edit it now? How can I see the disigner again? Thanks Vikas
-
Hi, Sorry, If I have posted this query to a wrong group! I'm facing an issue with C# project. I use VS 2005 express edition. I was developing a C# project and had couple of UI controls that I had placed using UI editor. Everything was fine but now I can't view the "UI designer" now. If I run the project I do get the UI that I had designed but cant edit it now? How can I see the disigner again? Thanks Vikas
-
Hi, Try to close the form and Rebuild Solution..and if the rebuild has succeeded..try to open your form again,sometimes i get the same problem but when i do that my UI designer can be view again Kind Regards, Tomi
-
I tried but still I can't see the form design! I guess, I will have to port the entire code into a new project now :((
Hi there . I think , it's better to check your reference files. Maybe you missed one of your reference . if it is , remove you reference from reference list and add it to your project reference again , and then Rebuild your solution or project , what ever as you want . :) :rose:
DMASTER
-
I tried but still I can't see the form design! I guess, I will have to port the entire code into a new project now :((
Hello, What you can try: In your project explorer, rightclick the Form or usercontrol you can not edit and change the "buildaction" to an other setting and then back to "compile" (I have not the english version and only 2003 so I don't know the exact names). Then make a rebuild. Hope it helps!
All the best, Martin
-
Hello, What you can try: In your project explorer, rightclick the Form or usercontrol you can not edit and change the "buildaction" to an other setting and then back to "compile" (I have not the english version and only 2003 so I don't know the exact names). Then make a rebuild. Hope it helps!
All the best, Martin
Hi, Ok I know why this is happening but pls tell me whats wrong in doing this? 1. My form is like this: Everything is proper and I can view the designer
//file Form1.cs public partial class Form1 : Form { // many functions/events related to UI controls are here }
2. I need to have a special control class say MyPictureBox derived from PictureBox so added the code as follows in file Form1.cs://file Form1.cs public class MyPictureBox : System.Windows.Forms.PictureBox { // some special code will be put here } public partial class Form1 : Form { // many functions/events related to UI controls are here }
Thats it: Now If I try to open the designer I get the error: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 service System.Windows.Forms.Design.ISelectionUIService already exists in the service container. Parameter name: serviceType Hide at System.ComponentModel.Design.ServiceContainer.AddService(Type serviceType, Object serviceInstance, Boolean promote) at System.ComponentModel.Design.ServiceContainer.AddService(Type serviceType, Object serviceInstance) at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IServiceContainer.AddService(Type serviceType, Object serviceInstance) at System.Windows.Forms.Design.ComponentDocumentDesigner.Initialize(IComponent component) at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo) at System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name) at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name) at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer) at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer) at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration) at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
-
Hi, Ok I know why this is happening but pls tell me whats wrong in doing this? 1. My form is like this: Everything is proper and I can view the designer
//file Form1.cs public partial class Form1 : Form { // many functions/events related to UI controls are here }
2. I need to have a special control class say MyPictureBox derived from PictureBox so added the code as follows in file Form1.cs://file Form1.cs public class MyPictureBox : System.Windows.Forms.PictureBox { // some special code will be put here } public partial class Form1 : Form { // many functions/events related to UI controls are here }
Thats it: Now If I try to open the designer I get the error: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 service System.Windows.Forms.Design.ISelectionUIService already exists in the service container. Parameter name: serviceType Hide at System.ComponentModel.Design.ServiceContainer.AddService(Type serviceType, Object serviceInstance, Boolean promote) at System.ComponentModel.Design.ServiceContainer.AddService(Type serviceType, Object serviceInstance) at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IServiceContainer.AddService(Type serviceType, Object serviceInstance) at System.Windows.Forms.Design.ComponentDocumentDesigner.Initialize(IComponent component) at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo) at System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name) at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name) at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer) at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer) at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration) at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
-
Hello, The Problem is that both classes have design support. It is not good practice to but them all in one file. If you put the picturebox in a special file you will also be able to open it over the designer.
All the best, Martin