Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some files in my project that started from a sample in the all-in-one code sample browser:

Some files contain boilerplate code that I modify heavily. They contain MS comments at the top that mention the license, copyright microsoft etc.

Am I required to leave the entire comment block at the top of the source files that I modify or is it okay to just include the MS-PL license in a separate file for the whole project?

share|improve this question
You should leave the original header. Clearly all of the code you modified must be released. – Ramhound Mar 22 '12 at 15:40
@Ramhound, that's not clear at all. MS-PL is a BSD-like license, which means you don't have to publish your code at all, even if you distribute the compiled binary. But if you distribute the source, it has top be under MS-PL. – svick Mar 22 '12 at 19:36
up vote 1 down vote accepted

I believe that you do need to keep those notices, per section 3.C of the licence:

If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.

share|improve this answer
But if you only distribute the compiled binaries, which don't contain comments anyway, then why would you need to leave the copyright notices at the top of the file? – Allon Guralnek Mar 22 '12 at 20:13
I think you're right: if you don't distribute the source code, you can remove the source code comments. – svick Mar 22 '12 at 20:44
Allon: That's a case of "you never know". Maybe in the future the code goes to someone else, who is not aware of any restrictions and publishes it in good faith. The resulting legal problems probably fall back to the programmer who removed the comments. – user281377 Mar 22 '12 at 20:46
@ammoQ, if the code got to someone else, then I think that counts as “distribution”. – svick Mar 22 '12 at 20:49
@svick: I'm not sure about that part (IANAL) and usualy it doesn't matter, but what happens later is more likely a problem. – user281377 Mar 22 '12 at 20:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.