Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Design view crashes when Visual Studio is previously closed with our forms open
 

Design view crashes when Visual Studio is previously closed with our forms open

Hello

We have a project with a couple of forms with custom controls which sometime crashes the design view.

It seems to crash only when opening the solution after previously closing Visual Studio with the forms open in design view. Currently we can go around the problem by closing all open forms containing our custom controls, close Visual Studio and open it again.

We're running Visual Studio 2008, any ideas how to fix this problem?

Thanks
// Lasse
LasseJ  Tuesday, February 03, 2009 10:25 AM
Hi LasseJ,

When you said the designer view crashed, did you mean the you couldn't see the designer view of the form and controls, but throws the error exception? If so, what did the error indicate?

The factor which may cause the designer can't display the control properly may be the errors in the code or you are using a bad reference of third party controls in your project. In both cases, the designer will not know how to display the controls.

Try to rebuild your project instead of closing all of the forms and re-opening all of them, and see if it helps.

Best regards,
Bruce Zhou

Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Thursday, February 05, 2009 1:53 AM
We are changing the issue type to “General Discussion�because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question�by opening the Options list at the top of the post editor window, and changing the type. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.
Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Monday, February 09, 2009 2:45 AM
Sorry for my delayed reply.

Rebuilding all our solutions doesn't help the only solution to the problem is to close all views before closing visual studio and reopen it again. This has been a problem since we've migrated to Visual Studio 2005. It isn't a critical problem for us but nonetheless annoying.

Our application is based on plenty of solutions where we have a platform containing the custom controls we're using from other solutions in our designer. By crashing I mean that the design view couldn't load our view the error it gives is:

Could not load file or assembly 'PlatformThemeDll, Version=540.0.0.24944, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Instances of this error (1)
1. Hide Call Stack
at [Company].Platform.Base.ViewSimple..cctor()

Any ideas why this occurs? As said earlier this does only happens when were loading a solution in Visual Studio where we havn't closed all design views in our previous session making it to load them at startup.
LasseJ  Monday, February 09, 2009 10:16 AM
Hi LasseJ,

Yes, I can understand. As the error indicates, The assembly 'PlatformThemeDll, Version=540.0.0.24944, Culture=neutral, PublicKeyToken=null' can't be loaded. Are you make sure this assembly exists in your project? If not, try to add it as a reference by right clicking the reference node under the project in the Solution Explorer.

Waiting for your test results.

Best regards,
Bruce Zhou

Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Monday, February 09, 2009 10:26 AM
I believe it's loaded correctly, I have no trouble building the solution and running the application even if the design view doesn't load.

To clarify; the referred dll isn't built in the same solution as the one which receives the design view errors.
LasseJ  Monday, February 09, 2009 10:30 AM
Have you tried to rebuit this referred dll? You can first delete the original reference and then add it again once you rebuilt it.

Best regards,
Bruce Zhou

Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Monday, February 09, 2009 10:48 AM
Have tried that, this has been a problem for all our developers for a couple of years now so I believe most of the rebuild, re-add and other common ways to solve the problem have been tried.

The reason why I started this thread is because we upgraded to Visual Studio 2008 from 2005 and still have the problem.
LasseJ  Monday, February 09, 2009 11:43 AM

Hi LasseJ,

We can see that it's because the assembly of that custom control isn't loaded properyly. So the designer doesn't know how to present the controls.

I've been trying to reproduce this problem. However, I guess the project is not large and not complex so thaterror can't be reproduced.Can you make a repro of this problem? You can keep it as simple as it could be and remove the confidential information. We only need this to reproduce and find a way to solve this problem.

If you think it is an issue ofthe product, you can aslo post the suggestion to the connectfeedback portal. Our developer will evaluate them seriously and take them into consideration when designing future release of the product.

Best regards,
Bruce Zhou


Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Monday, February 09, 2009 12:58 PM
This is a rather large project, containing above 1,5 million lines of .net source code in about 20 solutions, it will take ages to remove the confidential information but I will give it a try to reproduce the problem. I'll return with the results.

Thanks for your help so far!
// Lasse
LasseJ  Monday, February 09, 2009 2:58 PM
Greetings, we have a similar problem in receiving the "Could not load file or assembly x.....". This is a Visual Studio 2005 project upgraded to VS 2008. This solution contains 4 projects, and the only way to get around it is to close the Windows Form window, right click each project in turn, and select Rebuild for each project. Then right click the Solution and choose Rebuild. Then it will open the Form designer. Also, when adding new code, breakpoints in the new code won't be seen unless the previous process is performed. Or if they are hit, we get a message stating that the code has changed since the last compilation.. The system in question is running Windows Vista x64 with Visual Studio 2008. The project is set to compile in x86 compatibility mode (it uses an Access database, yes I can hear the comments now).
Paul Wakeman  Monday, February 09, 2009 8:17 PM
Sorry, I'm not able to reproduce this error in a sample project.
LasseJ  Wednesday, February 11, 2009 3:36 PM

You can use google to search for other answers

Custom Search

More Threads

• How to change the bitmap of a component in the designer
• prevent dashed border from being drawn around panel
• ListViewSubItem does not get update when modify?
• how can i fit win form to current working screen?
• Default licensing does not work for a windows custom control
• Compilation in IDE: persist component state
• how to diasble cells in datagrid view
• usercontrol !
• Collection not adding the controls...
• Designer crashes