簡體   English   中英

如何更改 Visual Studio 中新建文件的默認文本 header?

[英]How can I change the default header text of a newly created file in Visual Studio?

我正在使用 Visual Studio 2022。我當前的項目有代碼分析器(帶有.editorconfig文件)。 每當我在這個項目中創建一個新文件時,一個 header 文本會自動附加到文件的頂部,說

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace MyClass
{
    ...
}

我試圖搜索一個地方來更改此文本Licensed to the .NET Foundation... ,但無濟於事。 有誰知道我可以在哪里更新 Visual Studio 2022 中的默認 header 文本? 非常感謝。

您可以通過設置 file_header_template 的值通過file_header_template規則更改文本,例如

file_header_template = Licensed to foo bar

Microsoft 提供了更多詳細信息和示例: https://learn.microsoft.com/en-us/visualstudio/ide/reference/add-file-header?view=vs-2022

暫無
暫無

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

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