Click here to Skip to main content
15,914,452 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
We had a dept wide Windows patch update. Today, I have been getting designer errors, "The designer could not be show for this file because none of the classes within it can be designed. The designer inspected the following classes in the file. The Base could not be loaded. Ensure the assembly has been referenced and that all projects have been built."

This is occurring in several WindowsForms classes where before, it compiled fine without these errors/warnings. Would a windows patch update interfere with a windows app project? I have cleaned, rebuilt, deleted and readded, check my dll references are ok. I use VS2012, c# windows form. Any suggestion as to what causes it?
Posted
Comments
BillWoodruff 12-Jan-15 23:14pm    
It may be helpful if you can easily locate a project created using the same version FrameWork that does work in order to try and A/B test it with one that's broken, and locate some critical difference.

Have you created a new Project from scratch, and verified you can compile, run, save it, close and re-open Visual Studio, re-load the Project and compile and run again ?

I realize these are probably things that seem almost "stupid" to try, but, in my experience, sometimes eliminating the simplest cases pays off.

Hardly. I can guess what happened. 1) The project still compiles, just try it. 2) Before Windows patch, the designer view already wasn't displayed; you just did not pay attention for that. 3) You did not pay attention for that because before this view was not opened. Yes, you did not change the code, but you changed the .suo file, current state of the IDE.

So, to start with, close the designer view and ignore the problem. Try to compile it. Chances are, it will compile and may even work. If it does not compile, we have not enough information to solve you problem.

Now, how to solve the problem?

First, stop doing what you are doing and start doing software development. You will say, "How, what else do you thing we are doing? Software development!" I would not be so sure. I suspect that you are just wasting your time, or, more exactly, risking all your development time. To start software development, you need 1) start using some Revision Control System, 2) implement single-click batch build of all the software. If was was wrong in my assumption and this is all implemented, please forgive me and go to the next item. If I was write, do it immediately. Otherwise, your valuable code asserts are not yours, but they belong to the first slip of a hand or a hardware crash. You need to be able to retrace your steps in all situations.

Now, fix the form. I suggest to assume it was broken (it usually happens indirectly) during development well before you had the Windows patch update (and now you observe the result of usual coincidence, as many people before). Here is what could have happened. There are many aspects of the form (WPF window or other unit developed with the use of designer and/or XAML) which work fine during your application runtime but fail during designer's runtime. This is just the simple fact that different methods you implemented are called in different order and different environment. Your form methods may call some methods from other files, or you modified those methods without showing the design view for a while.

Try the following: enclose as much code of the form methods as you can in the check:
C#
if (!DesignMode) { /* ... */ }
In other words, keep existing functionality, but only execute most code when you are not in the designer. It's very likely that you can load your design view after this "trick". If it cannot help, continue debugging in a usual way. In further development, try to keep all questionable code which may potentially fail away from the form and design mode. Try to isolate UI from all other aspects of programming. This was one of the primary motivation items for MVC, MVA, MVP or MVVM.

Yes, I understand that I assume too much. But you did not provide information to find more specific cause of action. In my experience, most problems like yours circulated around the activities I tried to describe.

—SA
 
Share this answer
 
v4
I can respect the preaching, errors and all, but I have inherited some unfinished code created by a contractor. The guy left, I took over. End of story. I hope that fulfills your presumptuous manner. I use TFS source control where I was able to shelve my pending changes, yet retrieve a changeset for the 3 corrupt files. In which I may have unintentionally caused, but the errors are gone now. I only assumed that a patch update would be a cause due to other issues it created in our dept wide updates. My bad.

Fixing errors and debugging is not a waste of time to me. As much as I appreciate your preaching, this is not what I come to this site for. I have had help with other code which I respect those who provide solutions and not blather on like they are scolding a child!!! Thank you.
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 29-Apr-15 19:42pm    
Who are you talking to?

Sorry, this is not an answer. Such posts are considered as abuse. You could simply informs the readers using comments or "Improve question". I would advise to remove this post, to avoid abuse reports.

And how could you even self-accept this answer? This looks like cheating. People get answers accepted when they do hard work trying to help others. And what are you doing? Just behaving childish, trying to play offended card. On this side, we don't appreciate complaining or accusations on personal problems. Please, try to keep to the topics of the forum, if you cannot offer anything more interesting.

Please understand: nobody wants to hurt you, we are just trying to help; and some criticism could be important part of it. Apparently, you did not learn to appreciate it. You tend not to accept valuable answers, but, by some reason, decided to accept formally some text with your own complain. Please understand: what you write can be read by anyone.

—SA

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



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