dotnet / dotnet/roslyn

file_header_template ignored

Open
#82,223 0 comments 0 reactions 0 assignees View on GitHub
Area-IDE
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/file_header_template-ignored/11023235)._

---
[severity:It's more difficult to complete my work]
[editorconfig.zip](https://aka.ms/dc/file?name=B77aca7d6c96d4e538f3dc506cf7802e1639030338579347246_editorconfig.zip&tid=77aca7d6c96d4e538f3dc506cf7802e1639030338579347246)

I inserted the enclosed file in my .slnx solution (and also in the project, a console app), but the header never appears in the new files neither can be added to existing ones.
The same file worked fine in vs2022.

---
### Original Comments

#### Feedback Bot on 1/5/2026, 06:41 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

#### Michael Hawker [MSFT] on 1/6/2026, 02:12 AM:

I similarly have a file_header_template setup in my editor config. When I select “Run Code Cleanup (Profile 1) on Solution” (which includes the “Apply file header preferences” fixer), I see it run on some of my files but not all.


It appears to not apply the file header preferences to the startup project (only difference I can tell). It applies other fixers to these files, and applies the file header in other projects, but this one project is not applied.


(One other thing I noticed after is if I manually trigger the code-refactor with Ctrl+. in a file it does offer the suggestion to add the file header, but it’s with an incorrect/different header???)


image.png


This is not the correct file header suggestion, it should be, from my .editorconfig:


# .NET Foundation Header

file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license.\nSee the LICENSE file in the project root for more information.

The other license is not listed anywhere in my repo except on specific file (which needs to retain that license copied from another project).

#### Chan Kok Tien (Centific Technologies Inc) [MSFT] on 1/14/2026, 00:37 PM:

Thanks for your sharing the detail steps, I can reproduce this issue through your shared steps and this issue has been escalated for further investigation, if there is any process, I will inform you immediately.

#### Feedback Bot on 1/15/2026, 07:48 PM:

This issue is currently being investigated. Our team will get back to you if either more information is needed, a workaround is available, or the issue is resolved.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the behavior with the attached .editorconfig in the .slnx console app, comparing new files, existing files, Code Cleanup, and the Ctrl+. suggestion with VS2022. The issue is done when file_header_template is applied consistently and the configured header is offered and used in each reported path.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.