Your project file has become invalid.
A valid project entry for the form is as follows:
<Compile Include="Form1.cs"> <SubType>Form</SubType> </Compile> <Compile Include="Form1.Designer.cs"> <DependentUpon>Form1.cs</DependentUpon> </Compile>
At the same time, the DependentUpon line is missing, so the code and designer files are displayed separately in the project, and are not connected:
<Compile Include="mainForm.cs"> <SubType>Form</SubType> </Compile> <Compile Include="mainForm.Designer.cs" />
If you added a missing line, the form displays correctly in design mode:
<Compile Include="mainForm.cs"> <SubType>Form</SubType> </Compile> <Compile Include="mainForm.Designer.cs"> <DependentUpon>mainForm.cs</DependentUpon> </Compile>
And to remove the resource file:
<EmbeddedResource Include="mainForm.resx"> <DependentUpon>mainform.cs</DependentUpon> </EmbeddedResource>
To fix this, you can simply edit csproj in the editor or do it in Visual Studio:
- Back up files
- Right-click the project and select Upload Project
- Right-click the downloaded project and select "Edit [project_name] .csproj"
- Make changes and close the file.
- Right-click the unloaded project and select "Update Project"
source share