Simon Mourier's Avatar
Simon Mourier's blog (1352 answers on StackOverflow) about Microsoft technologies C#, C/C++, .NET, WinRT, WinUI, COM, Interop, DirectX, Direct2D, Windows, ...
  • 🔎︎ Search
  • Categories
  • Archives
  • About Me
  • visual-studio

Visual Studio Item Templates and Resource Files

Jan 2, 2013 See the question and my original answer on StackOverflow

The parent-child relation should be declared using the DependendUpon tag in the C# project file (.csproj), like this:

<Project ...>
   ...
    <ItemGroup>
      ...
        <EmbeddedResource Include="Resources.resx">
           ...
        </EmbeddedResource>
        <Compile Include="Resources.Designer.cs">
            <DependentUpon>Resources.resx</DependentUpon>
            ...
        </Compile>
        ...
    </ItemGroup>
 </Project>
  • SmoBlog © 2010-2025 Simon Mourier. All rights reserved.
  • Privacy & Terms