I can't set the file header template for C# in Rider
I'm using Rider 2025.2.4, non-commercial version, on Linux.
I just enabled StyleCop. Now, whenever StyleCop is enabled in File|Preferences|Editor|Code Style|Enable StyleCop support, this is the file header I get:
// <copyright file="Fake.cs" company="PlaceholderCompany">// Copyright (c) PlaceholderCompany. All rights reserved.// </copyright>
The text I enter in File|Preferences|Editor|File Header Template only works when StyleCop support is deactivated.
I added an .editorconfig file to the root of the project that contains:
[*.cs]file_header_template = This is new.
It doesn't seem to have had any influence on Rider.
Is that normal? And, where can I set the header for files when using StyleCop?
Thanks!
Please sign in to leave a comment.
Hello,
It can be done using a stylecop.json file. Place it next to .csproj file and add the following content:
Then write this into .csproj:
This way you will get such a result:
Have a nice day!
Thank you so much! Sorry for the late reply, I didn't get any notification about it. I should have checked earlier.
Should you have any other questions or difficulties in the future, do not hesitate to contact support.
Have a nice day!