I can\'t seem to get the form and the designer files to link in my project. They look like this in the Solution Explorer.
I've seen the same problem in Visual Studio 2008. Usually after compiling or closing and re-opening the solution the problem would fix itself. In Visual Studio 2012 I know that I have problems if I try to Add > Existing Item and choose all three files. Typically you only want to add the top level form.cs and VS will automatically include the .designer.cs and .resx files.
Check the project (.csproj
) file.
Inside the ItemGroup
node, see if the .designer
file is associated with the code-behind file. The XML should look something like this:
<Compile Include="FormPrompt.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormPrompt.Designer.cs">
<DependentUpon>FormPrompt.cs</DependentUpon>
</Compile>
include the .resx file into the project and in the properties of this file set Custom Tool as ResXFileCodeGenerator
In VS2017 (c#) to solve it, in my case:
Check the project (.csproj)
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> Check this
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen> And Check this
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>