Ok, I am trying to make a custom Project template.
I have added the folders and class files and things and it compiles properly. I get the template built and I can install it into VS2012, then create a new project by selecting this template and it works fine.
The problem happens in the Windows Form and the settings file which are present in the template.
As you know, a windows form.cs also has a form.Designer.cs file linked to it, as well as a .resx file.
I have included the designer.cs and the .resx file, but as i said, when i use the template to create a new project, the form.cs and the form.Designer.cs files are present, but they are not linked. If I add a new button to the form, I see no changes to the form.Designer.cs, instead the designer generated code now seems to be generated in the form.cs itself.
The same problem happens to the settings file.
Here is the code in the project's .csproj file:
<ItemGroup>
<Compile Include="App.config" />
<Compile Include="Program.cs" />
<Compile Include="Bussiness_Logic_Layer\Sample_Logic.cs" />
<Compile Include="Bussiness_Logic_Layer\Interfaces\Sample_Interface.cs" />
<Compile Include="Bussiness_Objects_Layer\Sample_Object.cs" />
<Compile Include="Data_Access_Layer\Sample_Data_Access.cs" />
<Compile Include="User_Interface_Layer\Sample_User_Interface.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.settings" />
<Compile Include="Resources\Sample_Resource.resx" />
</ItemGroup>
Here is the code in the template's .vstemplate file:
<TemplateContent>
<Project File="ProjectTemplate.csproj" ReplaceParameters="true">
<ProjectItem ReplaceParameters="true" TargetFileName="Properties\AssemblyInfo.cs">AssemblyInfo.cs</ProjectItem>
<ProjectItem ReplaceParameters="true" OpenInEditor="true">App.config</ProjectItem>
<ProjectItem ReplaceParameters="true" OpenInEditor="true">Program.cs</ProjectItem>
<ProjectItem ReplaceParameters="true" OpenInEditor="false">Bussiness_Logic_Layer\Sample_Logic.cs</ProjectItem>
<ProjectItem ReplaceParameters="true" OpenInEditor="false">Bussiness_Logic_Layer\Interfaces\Sample_Interface.cs</ProjectItem>
<ProjectItem ReplaceParameters="true" OpenInEditor="false">Bussiness_Objects_Layer\Sample_Object.cs</ProjectItem>
<ProjectItem ReplaceParameters="true" OpenInEditor="false">Data_Access_Layer\Sample_Data_Access.cs</ProjectItem>
<ProjectItem ReplaceParameters="true" OpenInEditor="true">User_Interface_Layer\Sample_User_Interface.cs</ProjectItem>
<ProjectItem ReplaceParameters="true" OpenInEditor="false">User_Interface_Layer\Sample_User_Interface.Designer.cs</ProjectItem>
<ProjectItem ReplaceParameters="true" OpenInEditor="false">User_Interface_Layer\Sample_User_Interface.resx</ProjectItem>
<ProjectItem ReplaceParameters="true" OpenInEditor="false">Properties\Settings.settings</ProjectItem>
<ProjectItem ReplaceParameters="true" OpenInEditor="false">Properties\Settings.Designer.cs</ProjectItem>
<ProjectItem ReplaceParameters="true" OpenInEditor="false">Resources\Sample_Resource.resx</ProjectItem>
<ProjectItem ReplaceParameters="true" OpenInEditor="false">Resources\Sample_Resource.Designer.cs</ProjectItem>
</Project>
</TemplateContent>
here is some code from the template's .csproj:
<ItemGroup>
<Compile Include="Bussiness_Logic_Layer\Interfaces\Sample_Interface.cs" />
<Compile Include="Bussiness_Logic_Layer\Sample_Logic.cs" />
<Compile Include="Bussiness_Objects_Layer\Sample_Object.cs" />
<Compile Include="Data_Access_Layer\Sample_Data_Access.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="Resources\Sample_Resource.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Sample_Resource.resx</DependentUpon>
</Compile>
<Compile Include="User_Interface_Layer\Sample_User_Interface.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="User_Interface_Layer\Sample_User_Interface.Designer.cs">
<DependentUpon>Sample_User_Interface.cs</DependentUpon>
</Compile>
</ItemGroup>
My question is, how to properly include a settings or a windows form in a template so that its associated designer and resource files remain properly linked?