Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to post code taken from the .net framework and modified online? [closed]

I used reflector to view the code of the generic dictionary collection (Dictionary<TKey, TValue>) and modified that code to make it thread safe. I want to post this code on my blog so others can review it (and tell me if I did something wrong) and also use it in their projects if they want. Legally speaking, am I allowed to do so? I modified the original code heavily (and only took a few methods from the original code not the whole thing) but the base code is still the same, could be there any potential legal issues if I do this?

Note: Just in case some will point me to implementations of a thread safe dictionary, I know that there are already implementations of a thread safe dictionary using ReaderWriterLockSlim but I don't want any locking when reading (only when writing), besides I'm using .net 2.0 not 3.5 so I can't use ReaderWriterLockSlim anyway, also I read somewhere that the performance of ReaderWriterLock in 2.0 is very poor so I don't want to use that.

like image 993
Waleed Eissa Avatar asked Mar 24 '09 23:03

Waleed Eissa


1 Answers

Microsoft's Dictionary source code is governed by a modified version of the Microsoft Reference Source License, which basically only allows you to read the code. So no, you're definitely not allowed to redistribute modified code under this license.

On the other hand, you can take Mono's implementation of Dictionary<K,V> and modify it to suite your needs, as it is licensed under the MIT/X11. It performs quite well compared to the one in .net.

like image 70
Jb Evain Avatar answered Oct 07 '22 03:10

Jb Evain