I'm developing a webpart in Sharepoint 2013 using VS2012. In this webpart I'm using a custom dll that I created. The library framework is 4.0 and the visual webpart framework is 4.5.
The problem is when I'm adding the webpart in sharepoint page, the following error appeared:
Could not load file or assembly 'RulesDll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d2371e81bc184aa5' or one of its dependencies. The system cannot find the file specified
Searching in google I found a lot of solutions to resolve this problem
Adding library to GAC using two methods.
(1) gacutil -i RulesDll.dll
(2) Using package ---> Advanced options in the solution explorer in VS2012
When I running gacutil -l RulesDll in VS command prompt everything sames to work:
Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.17929
Copyright (c) Microsoft Corporation. All rights reserved.
The Global Assembly Cache contains the following assemblies:
RulesDll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d2371e81bc184aa5, processorArchitecture=x86
Number of items = 1
So the library is in the GAC.
- Adding the library to the save control in web.config
But nothing works. Does someone know why it's impossible to add my own webpart in a sharepoint page?