Link to home
Start Free TrialLog in
Avatar of cmh_rwhelan
cmh_rwhelanFlag for Canada

asked on

Component not visible in Designer , but compiles and runs fine - Visual Studio 2010

I've been working with VS 2010 for a few weeks with no problems after upgrading to Win 7 64bit.  My solution (a windows forms database project using ADO.NET to view and manage a SQL Server DB) has been compiling and running fine throughout.
I just finished deleting and re-placing a Dataset in the project inorder to make it current with changes made to the SQL database.

The solution still compiles and runs fine.

However , the problem is in the VS IDE - in design mode, I cannot see one of the main controls ( a custom UserControl) that is contained in a GroupBox container.  All the code to generate the component exists in the designer, but when I look at the Document Outline, it does not exist.  It is not "Sent toBack" or anything.

Also, I did get an error once when trying to save changes while in this condition, error message something like " could not load the file or assembly XXXXXXXXXX ."

All my Google searches come up empty.  

All the code to generate the component is still there - it's just not loading into the IDE for some reason.

Any ideas??

Avatar of Anurag Thakur
Anurag Thakur
Flag of India image

it might happen due to some bug in the designer of VS 2010
I was just checking on google about visual studio 2010 designer bugs and there are a lot of issues reported by the users
Try updating VS 2010 to SP 1 may be it will resolve the issue
also do have a look at initializecomponent() method, most of the time we overlook it.
Avatar of cmh_rwhelan

ASKER

I've installed VS2010 SP1 - no change in the behaviour.  The InitializeComponent method is being called OK when run in debug.   I am targeting Any CPU during build,  and the solution compiles and runs fine, but both in the IDE and running in Debug, the component ( derived from a winforms tab control ) is not visible.

The dataset replacement operation that I performed prior to the bug showing up was not a new operation;  I have deleted and replaced the dataset numerous time in the development.

Any other ideas?

Not really, you can try contacting microsoft for further help on the issue
Have you checked that your project is having any dead reference (A refered project is not available and it is not used currently- so project is compling, which will be displayed with yellow warning icon in solution explorer) ?. Because, The designer will  load all refered assemblies before show a form. if loading is failed, the controls won't be populated. if you any dead reference, remove it and compile solution. close VS IDE and  reopen the solution.

Hope this helps.
ASKER CERTIFIED SOLUTION
Avatar of SameerJagdale
SameerJagdale
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The reference for the component must have been broken at some point - though not sure why..

cleaning and re-refenencing the same assembly (still at the same file location) seemed to fix it.

thanks Sameer - saved me a lot of work.  

Greetings from Canada.

RW
Glad to know. Enjoy!