0

When I try to view the designer of a win forms it keeps on showing a very unusual(to me at least) error:enter image description here

I cant figure out what is the problem here. The solution builds/runs just fine, I see no reason for it to not load it.The error it shows is nonsensical, the two type are one and the same.

The IDE is VS 2015, and the form inherits a DevExpress 14.1 form XtraUserControl.

Call Stack:

at Tervel.WinClient.Controls.BaseUserControl.InitializeComponent() in H:\LegacyCollection\SmartIT\E-Check\E-Check\master\WinClient\TGlobal\BaseUserControl.Designer.cs:line 43

at Tervel.WinClient.Controls.BaseUserControl..ctor() in H:\LegacyCollection\SmartIT\E-Check\E-Check\master\WinClient\TGlobal\BaseUserControl.cs:line 95

My question is, what could by the problem/cause and how can I fix it?

Community
  • 1
  • 1
  • 1
    Are you changing anything related to the form during run time? Sometimes if the designer needs a value that can only be given during run time, this happens. If you run your application, does the form open normally? – Paul Karam Sep 12 '18 at 08:02
  • 2
    Click on "Show Call Stack". Then it should show you line where the error is occurred. Go there and comment the line. – Tiber Septim Sep 12 '18 at 08:03
  • you can also go there and post the line here :) – Mong Zhu Sep 12 '18 at 08:05
  • 1
    (1) try Clean Solution, (2) try close+restart Visual Studio, (3) try [clearing the Visual Studio cache](https://www.matteopozzani.com/visual-studio-cache-cleanup/), (4) upgrade to VS 2017 :-) – Peter B Sep 12 '18 at 08:05
  • Take a look at following posts: [Can't view designer when coding a form in C#](https://stackoverflow.com/a/32299687/3110834) and [Windows Forms Generic Inheritance](https://stackoverflow.com/a/33112824/3110834). – Reza Aghaei Sep 12 '18 at 08:09
  • 1
    Are you doing anything in the constructor that relies on data that will only be available at runtime? – Handbag Crab Sep 12 '18 at 08:12
  • @PaulKaram,@HandBag When I run the application it opens normally. Its a very large project, but from I can see i don't give it any value that is accessible only during run. – Nikolay Minev Sep 12 '18 at 08:14
  • So.... the Stacktrace says what? – Rand Random Sep 12 '18 at 08:17
  • @RandRandom added it to the question – Nikolay Minev Sep 12 '18 at 08:20
  • So what is in the lines 43 and 95 of the BaseUserControl? Did you change that object recently? – TaW Sep 12 '18 at 08:29
  • 1
    @kokosaish it's irrelevant that your application runs fine, the designer can't render it. In my experience if you're, for instance, loading data in the constructor of your form then try to open it in the designer it will fail as the supporting objects are not avaiable. Make sure your form has a non-parameter constructor that just contains InitializeComponent(). If it does then it will be something else and I'd suggest posting your constructor code and any inherited form code too. – Handbag Crab Sep 12 '18 at 08:37
  • 1
    `in the context 'LoadNeither`' is very, very bad. There is probably an Assembly.LoadFile() behind that one, being used more than once to load the List<> class. https://stackoverflow.com/q/2500280/17034 – Hans Passant Sep 12 '18 at 08:59

1 Answers1

0

Found it.The problem was I was trying to load a resource file(in a distant class that I didn't notice the form depended on) that wasn't cheked out properly, due to Team Foundation Server problems.