1

Lets say I have a third party webpart which uses a DLL and pushes it into the GAC. Moreover I have custom webpart which I developed which also uses the same DLL but in a different version which is also pushed into the GAC.

Due to the fact that the DLL is already in the GAC I cannot deploy the third party solution.

What is the recommended way to handle such issues?

1
  • why you can't deploy it ? Commented Sep 11, 2013 at 8:52

2 Answers 2

1

Lets say I have a third party webpart which uses a DLL and pushes it into the GAC. Moreover I have custom webpart which I developed which also uses the same DLL but in a different version which is also pushed into the GAC.

You can have different versions of DLLs in GAC.

I got two different version's DLLs in GAC as shown in picture below,

enter image description here

Edit

OR if you can add app.config to your webpart and then add Assembly Binding Redirect.

4
  • And how would I do that? Because right now SharePoint does not accept two solutions with the same library which only differ by version. It is not a question that the GAC supports it. My problem is that I need to know how to do this via a solution package.
    – André
    Commented Sep 11, 2013 at 8:53
  • when you deploy your solution it should put DLLs in gac itself, however you can drag and drop them to assembly as well if you are using Server 2003, 2008, what do you mean SharePoint does not accept two solutinos ? Commented Sep 11, 2013 at 8:55
  • My solution, which I have developed, is already deployed. When I now try to deploy the third party solution I get the error message Error: Cannot add the specified assembly to the global assembly cache: Newtonsoft.Json.dll.
    – André
    Commented Sep 11, 2013 at 8:57
  • 1
    In your webpart solution find the dll "Newtonsoft.Json.dll" and then set its property "Copy Local" to false and rebuild solution and re-deploy it, should solve the issue, however I would recommend you to use web application's bin folder if webparts will be used within single web app. Commented Sep 11, 2013 at 9:04
0

If you need the newest version, upgrade your solution to fit the newest third party requirements und only take the newest DLL.

2
  • Would be an option but I'm using a newer version than the third party solution. Therefore this way is not an option for me.
    – André
    Commented Sep 11, 2013 at 8:54
  • Ok, got it wrong. Thought you use a DLL from a third Party solution. Nevermind
    – wu5chl
    Commented Sep 11, 2013 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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