6 Replies - 261 Views - Last Post: 18 June 2019 - 06:18 AM Rate Topic: -----

#1 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2942
  • View blog
  • Posts: 11,425
  • Joined: 03-December 12

Newtonsoft.Json reference missing on dynamic assembly

Posted 17 June 2019 - 10:01 AM

Quite perplexed today. I am getting the can't find assembly error,

Quote

Assuming assembly reference 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' matches 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed', you may need to supply runtime policy


Okay fine, I add the reference, remove the old, still throws. Now, this is different in regards to how the code is employed as well, it is a dynamic script that comes from the database, we have several of them, and this is the only one that has issues. I have compared a known good version to this one to see what differences there are, nothing that has jumped out at me.

Anyone have any weird corrections that they've run across?

Is This A Good Question/Topic? 0
  • +

Replies To: Newtonsoft.Json reference missing on dynamic assembly

#2 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7056
  • View blog
  • Posts: 23,989
  • Joined: 05-May 12

Re: Newtonsoft.Json reference missing on dynamic assembly

Posted 17 June 2019 - 11:32 AM

Look at your app.config or web.config to see if there are any version mappings. See Redirecting Assembly Versions
Was This Post Helpful? 0
  • +
  • -

#3 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2942
  • View blog
  • Posts: 11,425
  • Joined: 03-December 12

Re: Newtonsoft.Json reference missing on dynamic assembly

Posted 17 June 2019 - 11:45 AM

Tried it a few ways,

      <dependentAssembly>

        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />

        <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />

      </dependentAssembly>


I have also checked the csproj file, and lastly removed the assembly altogether and had Nuget install the version again....

Like I mentions, we have about 40 checklists that all work this way, this is the only one that it throwing this exception and all of them have a base that is modeled after, I don't understand why this one is throwing the exception, when it doesn't even use the lib to begin with!
Was This Post Helpful? 0
  • +
  • -

#4 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2942
  • View blog
  • Posts: 11,425
  • Joined: 03-December 12

Re: Newtonsoft.Json reference missing on dynamic assembly

Posted 18 June 2019 - 05:16 AM

New attempt will be to strip everything out and start incrementally adding parts until it blows again. That's all I can think of.
Was This Post Helpful? 0
  • +
  • -

#5 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7056
  • View blog
  • Posts: 23,989
  • Joined: 05-May 12

Re: Newtonsoft.Json reference missing on dynamic assembly

Posted 18 June 2019 - 06:06 AM

Have you tried using FUSLOGVW to try to determine who or what is loading the assembly?

Or at worse run procmon.exe to see at what point in time the assembly is being loaded?
Was This Post Helpful? 1
  • +
  • -

#6 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2942
  • View blog
  • Posts: 11,425
  • Joined: 03-December 12

Re: Newtonsoft.Json reference missing on dynamic assembly

Posted 18 June 2019 - 06:11 AM

No, didn't know it existed! But, that will be the next step if this doesn't determine the issue!!!


If I could +1 that more, I would!
Was This Post Helpful? 0
  • +
  • -

#7 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7056
  • View blog
  • Posts: 23,989
  • Joined: 05-May 12

Re: Newtonsoft.Json reference missing on dynamic assembly

Posted 18 June 2019 - 06:18 AM

I also assume that you are trying the various answers in this SO question.

The two answers that jumped out at me were the one about NUnit requiring .CONFIG files to sit as siblings of the .NUNIT file; and the one about XML namespaces.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1