I am working on a project that only contains Models and I have a lot of properties like this one:
public string FromReversed
{
get
{
return From.ReverseString();
}
#if MyDirective
[Obsolte("Only in here because if the setter is not included the this property will not be saved into mongoDB")
set { }
#endif
}
When using the Rider IDE I get this warning: 'value' parameter is not used
I can disable that warning by placing this comment // ReSharper disable once ValueParameterNotUsed
on top of that property or by placing this comment // ReSharper disable ValueParameterNotUsed
at the top of my file. Now my question is how can I disable that warning for the entire project?
I have attempted these 4 things with no success:
If I do
'.' + Enter
and then change the severity of that warning from warning to 'Do not show': Doing so makes the warning go away but I want that warning to also appear in other projects. I just want to ignore that warning for this specific project withtout having to go to every file and place// ReSharper disable ValueParameterNotUsed
.I have tried placing this attributes on my GlobalUsing.cs file:
global using Swashbuckle.AspNetCore.Annotations;
global using JetBrains.Annotations;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
// This works if I place this attribute on top of the class
[assembly: SuppressMessage("ReSharper", "ValueParameterNotUsed")]
I tried placing
resharper_value_parameter_not_used=none
line on.editorconfig
based on this article https://dunnhq.com/posts/2020/codeinspections/. But I am probably naming the property incorrectly.I have tried placing the id of that warning because it contains no number on the tag of my .csproj file like so:
<PropertyGroup>
<NoWarn>1701;1702;ValueParameterNotUsed</NoWarn>
</PropertyGroup>
This file contains the global settings for Rider in Windows 11:
%UserProfile%\AppData\Roaming\JetBrains\Rider<Version>\GlobalSettings.DotSettings
I noticied that when I changed the inspection severity like this:
]
Then this line was added to my
GlobalSettings.DotSettings
fileThe solution was to move that configuration from
GlobalSettings.DotSettings
file toMyProject.csproj.DotSettings
. And now those changes only affect the specific project that I want.