views:

121

answers:

1

I am preparing several in-depth code samples for prospective employers. Within the sample I have included references to several open source projects, Moq and StructureMap.

For some of the functionality I need to modify portions of an expression tree and the standard method is using an ExpressionVistor such as this example/code sample from MSDN. I would like to use it but I cannot understand the licensing and whether or not the license allows me to use it for project. Any suggestions?

On a side note this particular chunk of code is rampant out in the wild. Any project that does expression trees seems to be using it.

EDIT: I guess what I am confused about is the wording behind the license. What constitutes a sample? To comply with the license I have added the license and links to the original source.

+2  A: 

The important quotes from the license agreement is this: "If Microsoft makes any code marked as “sample” available on this Web Site without a License Agreement, then that code is licensed to you under the terms of the Microsoft Limited Public License."

These are the relevant clauses in the MLPL:

2(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.

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

3(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.

3(F) Platform Limitation- The licenses granted in sections 2(A) & 2(B) extend only to the software or derivative works that you create that run on a Microsoft Windows operating system product.

So, as long as you follow those requirements, you're allowed to reproduce that code.

Josh Yeager
What makes it a sample? Anything they post? It is not clear to me.
smaclell
Good question... The clause before the one I referenced says "If Microsoft makes Software available on this Web Site without a License Agreement, you may use such Software to design, develop and test your programs to run on Microsoft products and services."The code in the article you linked has "Example" headers. I guess the question is, does that header mean that it's "Sample" code, or does it mean that it's just uncategorized "Software"?
Josh Yeager