2

I have tried updating the nuget package, tried replacing i've even deleted the file and re installed but still this is occurring when i try to upload it in My domain hosting in godaddy. Previously i had a error that allowDefinition='MachineToApplication' beyond application level. I googled it and changet it in my web config. now the problem is with this error. ive even changed the dependent assembly to

    <dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
      <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="7.0.0.0" />
    </dependentAssembly>

The current version of Newtonsoft.json im using is 7.0.1.. can any one guide me i'm new to this.

image

Note: The Hosting which i'm using is plesk hosting and my .net is 4.5

Sai Chaitanya
  • 195
  • 1
  • 1
  • 13

5 Answers5

1

Update the correct version of the installed version? Else install specific version 7 with nuget

Web.config:

<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="7.0.1" />.

Install nuget specified version:

Install-Package Newtonsoft.Json -Version 6.0.8

Alternative Web.Config add package:

<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
Jelle Oosterbosch
  • 1,731
  • 15
  • 17
  • I've tried it but no luck!! when i've launched it in my local host there is no problem the app was working fine but when i ve hosted in my web-hosting in godaddy.com the problem is coming!!! – Sai Chaitanya Nov 19 '15 at 10:14
  • Added an alternative solution maybe, in config, search for the record I added, ar add it yourself. – Jelle Oosterbosch Nov 19 '15 at 10:19
0

uninstall or remove Ref and reinstall make sure you are Connected to internet just Go to Package manager Console and enter the Following command

**

Install-Package Newtonsoft.Json -Version 7.0.1

** Do enter

0

You could try letting NuGet update the binding redirect for you to make sure you have it exactly correct.

Open NuGet Package Manager Console and select your host project in the drop down. Then enter the Add-BindingRedirect command.

Also, double check that version 7.0.1 is the version referenced by your host project and that is the version of the dll making it to the bin directory (right click the dll, properties, details tab, file version).

TylerOhlsen
  • 5,485
  • 1
  • 24
  • 39
0

Running Visual studio 2015 as administrator resolved this issue for me.

Note: My pc is connected to internet.

Ram
  • 15,908
  • 4
  • 48
  • 41
0

To solve this problem please do the following steps

Step#1

Delete Newtonsoft.Json dll from bin folder if any.

Step#2

If you are using web application project go to webconfig and remove these assembly references otherwise delete all assembly references from packageconfig etc.

remove lines

Step#3 Install Newtonsoft.Json again

Install-Package Newtonsoft.Json -Version (Version Number Here)