Results 1 to 4 of 4

Thread: Designer Issue

  1. #1

    Thread Starter
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,109

    Designer Issue

    I'm not sure what to make of this. I have a WPF application that I haven't worked on for a couple months, but now have to add something to. The project opens fine, and it runs fine in the debugger, but it's also showing me numerous errors on every code page. So...it runs despite there being a whole bunch of errors...which clearly are not errors, because there's a definite pattern to them.

    The first error is in the constructor, because InitializeComponent isn't found. All other errors indicate that the designer page is lost, as far as the debugger is concerned. Every control is an error, because it is not declared. In WinForms, all of that would be located with InitializeComponent, but the layout is different with WPF.

    Since the program is running fine in the debugger, this appears to be something about the IDE having lost track of the declaration of both InitializeComponent and ALL of the controls on the form. How do I reconnect the two?
    My usual boring signature: Nothing

  2. #2

    Thread Starter
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,109

    Re: Designer Issue

    Apparently, this is a known issue for which a solution is actively being sought. This thread has some methods that might solve the problem, and might not:

    https://developercommunity.visualstu...48?sort=active
    My usual boring signature: Nothing

  3. #3
    Fanatic Member Peter Porter's Avatar
    Join Date
    Jul 2013
    Location
    Germany
    Posts
    585

    Re: Designer Issue

    Have you tried manually deleting all the contents of the "bin" and "obj" folder, and cleaned and rebuilt the solution? I've read this works at the link you provided, but the project strangely gets corrupted again in a few months down the line.

    Does your "x:Class" attribute in the XAML match the namespace and class name in the code-behind file?
    Last edited by Peter Porter; Jul 6th, 2024 at 08:22 AM.

  4. #4

    Thread Starter
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,109

    Re: Designer Issue

    Yeah, I did try that. Moving to .NET 8 appears to have solved it, but as the thread notes, the solution is only temporary. I was struck by the final post(s), where MS said that they were studying solutions. So, they acknowledge that this is happening, may be focusing in on a cause (they mentioned that they had a trace of it happening), and may solve it. They also seem a bit tentative about the whole thing, like they aren't very confident in any solution, yet.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width