Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change option 'Automatically insert license headers in new files' #74

Open
the-wazz opened this issue Aug 16, 2017 · 3 comments
Open

Change option 'Automatically insert license headers in new files' #74

the-wazz opened this issue Aug 16, 2017 · 3 comments
Labels

Comments

@the-wazz
Copy link

'Automatically insert license headers in new files' is incredibly misleading. I checked it and headers were added to every existing file. I didn't notice it for a while then saw I had over 400 changes in Team Explorer. Now I have to go through every file and undo the ones I didn't actually update.

Please change this FIRST.

@FlorianDecker
Copy link
Contributor

Hi the-wazz!

Thanks for the interesting issue report. I am sorry you got hit with such a time consuming bug.

Sadly, i could not reproduce your error. Could you add more information (such as Project Type and Visual Studio version. Best would be the solution/project itself for me to try :). Or maybe you can reproduce it with a new Project and send me the steps to reproduce? )

My tried steps:

  • Create new C# Commandline Project (tried VS2013 Professional and VS2017 Professional).
  • Add LicenseHeaderDefinition File.
  • Go to Tools -> Options -> LicenseHeaderManager.
  • Check 'Automatically insert license headers in new files'.
  • Verify that existing .cs file is untouched.

Looking at the code it seems highly unlikely that ticking the box itself does add headers to every existing file. Ticking the box only sets a flag, which checks after every "ItemAdded" event if the LicenseHeader should be applied to that file. So one possible error could be something triggering that event for all your existing files. I once read that something like this could happen with some ProjectTypes but was never able to reproduce it.

Please provide me with more information so we can fix this issue.

With regards,
Florian Decker

@the-wazz
Copy link
Author

the-wazz commented Aug 17, 2017

Hi, thanks for the reply. I'll probably be able to try to reproduce it next week.

  • VS 2015 Community
  • Web Site; Web Forms. (It's a web site, but I've moved it to the projects folder so I can use Team Services).

2017-08-17-team-services-changes-pending

@FlorianDecker
Copy link
Contributor

Thanks for the additional info!

I played around a little bit with these ProjectTypes but i am still not able to reproduce it. So i would really love a repro :)

Sidenote: The LicenseHeader also only gets applied to newly added files if it finds a respective LicenseHeader in the .licenseheader file. This means, beside this bug, if you dont want specific files to get automatic updates from the LicenseHeaderManager, you should revisit your .licenseheader file, as your source files would also get updated if you do "Right Click -> LicenseHeaders -> "Add License Headers to All Files"" on your Project or Solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants