Last post Jun 05, 2017 06:27 AM by EvenMa
Jun 02, 2017 06:53 PM|itechathi|LINK
I have developed a Web API and it is working without any issues in my development environment(Windows7, Windows server 2008).
When i deploy the same in windows server 2012, I am keep getting the following error
I have tried all possibilities as mentioned in the internet like removing and adding the dll before build, install , reinstall the dll before build, configuration change, etc.... Now i am using Newtonsoft.Json version 6.0, Windows server 2012 R2, 64bit
Can someone help me to come out from this issue.
Jun 05, 2017 06:27 AM|EvenMa|LINK
At first, you could know what is the strong name of assembly, you could refer to the following link:
By default,ASP.NET search for an assembly from the bin directory or private path of an application.
When you register any assembly in the web.config without the strong name, the assembly should be in the web.config or private path.
When you register any assembly with the strong name, the assembly is loaded from GAC.
In your case, I suggest you could do by the following steps:
(1) remove the section of register assembly from the web.config.
<compilation debug="true" targetFramework="4.5.1" >
<!-- remove the following line-->
<add assembly="Newtonsoft.Json, Version=184.108.40.206, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" />
(2)Clean your solution, and then reinstall the Newtonsoft.Json from NuGet.
(3)Publish your web site and make sure the Newtonsoft.Json.dll is exists in the bin directory.
(4)clean Temporary ASP.NET Files directory on the server, and then restart IIS.
The Temporary ASP.NET Files directory is locating at %SystemRoot%\Microsoft.NET\Framework\versionNumber\Temporary ASP.NET Files .
If you have any other questions, please feel free to contact me any time.