mamift / LinqToXsdCore

LinqToXsd ported to .NET Core (targets .NET Standard 2 for generated code and .NET Core 3.1, .NET 5+ for the code generator CLI tool).
Microsoft Public License
43 stars 15 forks source link

Don't generate static XName fields for inherited properties #65

Closed jods4 closed 7 months ago

jods4 commented 8 months ago

Fixes #63

This is a long-standing issue, in fact LinqToXsd.Schemas.csproj contains this:

<!-- CS0108: ... hides inherited member ... Use the new keyword if hiding was intended. -->
<NoWarn>$(NoWarn);108;114;1591</NoWarn>

I have removed the generation of static XName fields for properties that are inherited, as a field was already generated in parent and is accessible. To ensure that it's always accessible, I added the protected modified, although you'd have to split your inherited classes accross assemblies for this to actually matter.

This fixes the instance of warning that was reported in #63, not sure if there are other situations where CS0108 could happen.