簡體   English   中英

規則 do.net_style_namespace_match_folder 不起作用

[英]rule dotnet_style_namespace_match_folder doesn't work

我的編輯配置

# top-most EditorConfig file, hierarchy search will stop in this file
root = true

# ----------------------------------------------------------------------------------------------------------------------
# Coding styles
# ----------------------------------------------------------------------------------------------------------------------

# Dotnet code style settings:
[*.{cs,vb}]
dotnet_diagnostic.IDE0055.severity = error
dotnet_style_namespace_match_folder = true:error

Class 我測試反對。 命名空間應與結構匹配並等於ConsoleApp1

namespace ConsoleApp1.NotHere
{
    public class Class
    {
        private int X { get; set; } = 0;

        public int Y { get; set; }
    }
}

解決方案構建沒有錯誤,命名空間未在 VS 中突出顯示。 我已經在 VS 2022 和 2019 中檢查了 .net 6 中的新控制台項目以及最新更新

VS 2022 社區版本 17.1.1

VS 2019 專業版 16.11

文檔說它應該在兩個 IDE 中都可用,但我無法讓它工作。 有任何想法嗎?

嘗試使用IDE0130診斷 ID:

dotnet_diagnostic.IDE0130.severity = error

請注意,語法option = rule:severity遲早會被棄用

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM