CS0534 validation adding wrong code.
- Dominant language
- No language data
- Stars
- 1.9k
- Forks
- 173
- Avg merge
- 10d 13h
- Merged PRs (30d)
- 1
Description
Hello everyone,
I am experiencing one issue and I could not find a workaround to that so far.
I am using dotnet format with Husky to keep our code consistent.
Dotnet runtime: 8.0.5
dotnet-format: 5.1.250801
husky: 0.5.4
I have this class below which I use to mock an HttpReponseData:
```
public class DocumentHttpResponseData : HttpResponseData
{
private Stream _body = new MemoryStream();
public DocumentHttpResponseData(FunctionContext functionContext) : base(functionContext)
{
}
public override HttpStatusCode StatusCode { get; set; }
public override HttpHeadersCollection Headers { get; set; } = new HttpHeadersCollection();
public override Stream Body { get => _body; set => throw new System.NotImplementedException(); }
public override HttpCookies Cookies { get; }
}
```
When I run dotnet-format using Husky, I got this rule being triggered:
**error CS0102: The type 'DocumentHttpResponseData' already contains a definition for 'Body'**
This is the resulting code:

I have tried to add to .editorconfig this configuration to try to avoid that:
`dotnet_diagnostic.CS0534.severity = none`
But I have had no luck so far.
Any insights?
Thanks in advance
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.