question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SA1516: misfire in C# 9 top-level statements

See original GitHub issue

Given this Program.cs file:

// Copyright (c) Andrew Arnott. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using MinerForeman;

var foreman = new Foreman();
await foreman.RunAsync();

The last line in the file above produces:

Warning	SA1516	Elements should be separated by blank line	Program.cs

This repros with StyleCop.Analyzers 1.2.0-beta.333

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:15
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
maxkoshevoicommented, Apr 18, 2022

I don’t believe anyone has submitted a fix for this issue yet.

@sharwell Created a fix: #3482

2reactions
sharwellcommented, May 3, 2022

Yep, waiting for a few more items to finish/merge and the next release should be soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Attributes on C#9 top level statements file
For some context: I want to disable a rule only in that file with: [SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1516: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found