0

Here is the problem: I have a root folder with sub folders containing all my structured code / 3rd party libraries / external dependencies. Now previously I used to develop with VSCode and used the Copyrighter extension by FordLabs to automatically insert the copyright text into all new files, which looked like this:

/*
 *   Copyright (c) 2023 My Company Name
 *   All rights reserved.
 */

My question is, how can I do the same for Visual Studio? Does there exist a plugin/extension that helps me do it?

doa4321
  • 176
  • 2
  • 9
  • I use to maintain my copyright notices with mere "replace in files". You can also define code snippets for single-key insertion. – Yves Daoust Apr 17 '23 at 09:36
  • @YvesDaoust can you please give some more details? How do you define code snippets? – doa4321 Apr 17 '23 at 09:45
  • https://learn.microsoft.com/en-us/visualstudio/ide/walkthrough-creating-a-code-snippet?source=recommendations&view=vs-2022 – Yves Daoust Apr 17 '23 at 09:54
  • What I do is just use a "magic" comment in my source files (like `// [copyright here]`) and then I have a `git` pre-commit hook that is a small python script that scans all the 'about to be comitted' files for that magic string and replaces it with the proper copyright notice before committing. Works well enough. – Jesper Juhl Apr 17 '23 at 11:12
  • Did the extension for VS2019 work for you? Are there any new errors? You can find historical versions in the product overview. – Minxin Yu - MSFT May 02 '23 at 09:30

1 Answers1

0

You can download the extension License Header Manager for VS2019

Support for Visual Studio 2019 + 2017 is provided via separate package available on GitHub as LicenseHeaderManager.2019.vsix

user20716902
  • 861
  • 1
  • 14
  • I tried installing this and apparently it is only supported upto VS 2018. Here is the [install log](https://pastebin.com/raw/wt5yhEeM) – doa4321 Apr 17 '23 at 09:44
  • I've updated the answer to provide the direct link for the VS2019 VSIX installer. (The log you provided shows that you tried to use the VS2022 VSIX installer) – user20716902 Apr 17 '23 at 10:20