Click here to Skip to main content
15,911,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello every one ,
I am working on one project..which has been devloped by some one else..the problem is their is one form that is not opening when i try to open it in design view..when i am running that application it is runnig fine with out any error.. so can any one tell me what could be the problem

thanks
Posted
Updated 23-Sep-11 17:59pm
v2
Comments
sravani.v 23-Sep-11 7:44am    
Do u have master page in your application?

Do a build first then try to open the form.

It could be that the form is using a component that is not installed, or you do not have a design time license for it.
 
Share this answer
 
Comments
darashraf 23-Sep-11 6:59am    
thanks for ur help..actually the thing is that i have one old version of that project in that version that form is same and it is opening on my machine..but then the project has been modified their has been made some changes in the code.and now is not opening..
i had tried all the ways..before building and after building i try to open it.
the form is using infragistics controls i had installed that.
clean the solution, check whether .aspx.cs name and .aspx page have same name ? buid again and check whether it works fine .if not working then,

it is better to take another form ,simply copy the design and paste in new form ,
 
Share this answer
 
Comments
darashraf 23-Sep-11 7:43am    
Sory i forget to say u that i am working on windows application
Note: not clear if you are working in WinForms, ASP.NET, or ... ?

Most of the time I've had this problem, in WinForms, there was some corruption in the Designer.cs file.

If you have the older file you can open, and this is WinForms, suggest you do a comparison of the Designer.cs files between the new Form you can't open and the old Form.

Look for any differences.

best, Bill
 
Share this answer
 
Comments
darashraf 23-Sep-11 7:45am    
i am working on windows forms..i had check all the differences between the old and the new code ...when i am removing the new code it is also not working i mean the form still is not opening..
may be your designer file is corrupted..,

check your <designer.cs> file
 
Share this answer
 
Comments
darashraf 23-Sep-11 7:47am    
yes it might be corrupted now what is your alternative for this
Which version of Visual Studio are you using and what is the exact message that is displayed. Newer versions of Visual Studio (2008 and 2010) are better at handling errors or giving some information on why they occurs. Half of the time Visual Studio 2008 or 2010 would give an hint where the error occurs.

Also, do you have multiple projects in your solution.

The first thing is effectively to clean the solution, close any designer, build (and run the application) and then open the designer again. If the form depend on another form, then try to open that form first. Sometime you also have to restart Visual Studio.

If you have done custom controls, then they might be bugged. In that case, you have to start another instance of Visual Studio to run the designer under a debugger so that you would be able to see what wrong with your code.

Typically if you have your own user control, you have to check if you are in design mode from the constructor or in Form_Load event if the code is somehow a bit complex. You would have to skip the code that does not make sense at design time.

In some complex projects, some forms are "hard" to open particulary when there are also C++ DLL and not all DLLs are up-to-date.

Also, you have to ensure that your reference are correct. One way would be top temporarily create a new form and add all controls that your are using in the form that cannot be opened.
 
Share this answer
 
v2
Hi,

This could be the reason your Form control/User Control is typed

or

there might be any issue with control being as null, when opening in designer mode

YOu can add a code like

C#
#if true

public class form : Form
{
}
#else

// Your existing code 

#endif



If you are seeing object null error, In constructor you can add a condition

C#
protected bool IsInDesignMode
        {
            get
            {
                return this.GetService(typeof(System.ComponentModel.Design.IDesignerHost)) != null;
            }
        }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900