In c#, when you create a form, a set of three files are created that seem to be vital:
- form1.cs
- form1.resx
- form1.designer.cs
I am required to add the form as a link to a file, so that the solution and source code are stored separately. I have moved these created files and added them as links as shown in this question:
Add File as a Link on Visual Studio - Debug vs Publish
But then the files are no longer linked together, so the GUI that has been created is lost (shows a blank form instead of what was added). I have tried forcing them to be linked together by editing the csproj as described in this answer. I added the DependentUpon
tag to each of the resx and designer files:
<Compile Include="Path\To\Form1.Designer.cs">
<Link>Form1.Designer.cs</Link>
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
But this just crashes Visual Studio.
I know that you can manually link them, by dragging from the file explorer into visual studio under the Form1.cs listed in the solution explorer. This will work and the resx and designer will be under form1.cs (and the GUI shows correctly), but will copy the file to the project directory (as in it is not added as a link).
Is it possible to achieve this?