aienabled / WpfNewProjectSystemSample

Sample WPF application using the new csproj format (.NET Core project system https://github.com/dotnet/project-system/ ). Targering .NET Framework 4.6.2 or higher.
MIT License
25 stars 5 forks source link

Properties Resources and Settings are not nested #4

Closed njannink closed 4 years ago

njannink commented 7 years ago

This looks really promising and I'm trying to use it. One thing I found is that resources and settings are not nested by default. I had to add the following lines to my csprojs but maybe you can include this in the base templates somehow.

    <!-- Resources -->
    <EmbeddedResource Update="Properties\Resources.resx" Generator="ResXFileCodeGenerator" LastGenOutput="Resources.Designer.cs" />
    <Compile Update="Properties\Resources.Designer.cs" AutoGen="True" DependentUpon="Resources.resx" DesignTime="True" />

    <!-- Settings -->
    <None Update="Properties\Settings.settings" Generator="SettingsSingleFileGenerator" LastGenOutput="Settings.Designer.cs" />
    <Compile Update="Properties\Settings.Designer.cs" AutoGen="True" DependentUpon="Settings.settings" />
aienabled commented 6 years ago

@njannink thanks for reporting! I've tried to add support for these item types but unfortunately VS continue ignoring the ContentType definitions from my ProjectItemsSchema.xaml (for some reason it works fine for XAML "Page" item type but not for EmbeddedResource).

I've noticed that if you're adding them via VS "Add item" they're added properly to csproj file with all the required properties. And *.Designer.cs files are properly displayed as the nested items. So it's not a big deal.

Regards!

njannink commented 4 years ago

no longer relevent