Reputation: 31
Newbie here struggling the way into the Matrix. I'am coding my first program ( VS 2019), and using a WinForms
Application I get the following error
Since this code is autogenerated I have no clue of what can be wrong
Upvotes: 1
Views: 1062
Reputation: 61975
tldr; Update the files (Form1.cs and Form1.Designer.cs) as needed to ensure that they define the relevant parts of the the same partial class - namespace and class name.
The InitializeComponent method (and components) should be defined in a partial code-behind for the design surface. In this case that is Form1.Designer.cs
- inspect that file to resolve the error.
The compilation error sounds like the classes are in different namespaces or different type names (and thus are not partial
to eachother), possibly from invalid generation or an unsynchronized change.
From the shown code, both files should have a Form1
class defined namespace strnull
.
Note: the strnull
namespace seems odd, perhaps an invalid template / generator. Update both files as needed to ensure that they define the relevant parts of the the same partial class.
Upvotes: 2