質問

In my spare time, I decided to browse Microsoft.SharePoint.dll classes with a reflector.

I exactly want to know:

Is it possible to decompile Microsoft.SharePoint.dll to do a bit of change and compile it again to add as a reference in my solution ??

役に立ちましたか?

解決

  • First of all, this operation is not supported,
  • Second, it's not possible for cryptographically signed DLL
  • Third, you can decompile the DLL to .csproj that can be opened via visual studio but what I think you will face more errors when you build back the exported project.

Meanwhile, I found an article that mentioned it's possible (I didn't try this before).

The article author use JustDecompile with Reflexil plugin to recompiling the DLL with your modifications.

For more details about this article check Recompiling your own version of the SharePoint code to suit your needs

他のヒント

The question is, why would you need to do that? SharePoint is a framework that allows you to extend it, and add whatever functionality you want on top of it. There's is no reason why you want to do that, if you want to do something that's not available, Microsoft has provided you with MANY ways to do it.

From the top of the SharePoint hierarchy, such as service applications. You can create your own service applications, and you can connect to external systems and do any kind of development you wish to do. That’s the reason Microsoft built SharePoint as a platform not as a product that you can use as is. So to decompile SharePoint dll in order to achieve something means you’re probably thinking about doing it the wrong way.

From a legal perspective, that's for sure not alowed by Microsoft.
From a technical point of view, it's most probably really impossible:

  1. You won't be able to add external dependencies for the DLL, such as native components it has.
  2. Some parts of the DLL won't be decompiled.
  3. You won't be able to strong-name the DLL with the same key as Microsoft.

By doing this, if you get it working, with a system that Microsoft would refuse to support. If you require a some specific functionally rewrite it with and adapter class in your code base

Also your recompiled code will break with any service release, cumulative update, hot fix or upgrade of version. In short you are using an API so get used to doing it the "right" way.

ライセンス: CC-BY-SA帰属
所属していません sharepoint.stackexchange
scroll top