False positive with attributes using internal properties of internal class from another (visible) assembly
Answered
Hello
I'm getting another false positive when using internal properties, from an internal class from another project which shows internal to the working project.
Example in the screenshot below

You can see the `Resources` project, which has a class `DataAnnotationsMessages` that is internal. It is visible to this project, and is correctly resolved. However an internal property of that said class is not correctly resolved by Rider.
The Resource class
namespace Resources.Localization.Resources {
using System;
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class DataAnnotationsMessages {
private static System.Resources.ResourceManager resourceMan;
private static System.Globalization.CultureInfo resourceCulture;
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal DataAnnotationsMessages() {
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
internal static System.Resources.ResourceManager ResourceManager {
get {
if (object.Equals(null, resourceMan)) {
System.Resources.ResourceManager temp = new System.Resources.ResourceManager("Resources.Localization.DataAnnotationsMessages", typeof(DataAnnotationsMessages).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
internal static System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
internal static string InvalidEmail {
get {
return ResourceManager.GetString("InvalidEmail", resourceCulture);
}
}
internal static string Required {
get {
return ResourceManager.GetString("Required", resourceCulture);
}
}
}
}
Project file to show that the internals are visible
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>Common</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
---------
Besides, if I could set a .resx file as public accessible in the Localization manager, it wouldn't overwrite all modifications I made to the generated .resx designer class.
Please sign in to leave a comment.
Hello Mathieu, thank you for reporting the issue, I have created a corresponding record on our bug tracker: RSRP-483522. Please watch it for monitoring the progress.