Giter Site home page Giter Site logo

Comments (4)

Perecli avatar Perecli commented on August 23, 2024

Is it possible for you to release a version of you library in .NET framework? This will probably solve the issue since a had a whole bunch of similar problems with other libraries when my project was targeting .NET standard. Those went away when I went back to .NET framework.

from ecobee.

i8beef avatar i8beef commented on August 23, 2024

.NET Standard is the way forward for the ecosystem at this point, so that would be a step backward. I can confirm that the NuGet package works just fine on a 4.6.1 framework project, so I'm confident in the implementation here.

The error in question means that your project is referencing an old version of the Json.NET library somewhere in your app and its conflicting. Likely if you look in your bin directory, you'll find the version of the library that is being copied is not the one you are expecting. In these cases, you have to look at all of the references across all your projects and find the mismatch. If its a NUGET mismatch, you can actually right click on the solution and go to "Manage nuget packages", and it'll have a new tab at the top called "Consolidate" that will let you make sure the same version of the package is referenced across all your projects. If you manually added references to your projects though (note: you almost NEVER want to do that for this reason) then you are going to have to manually go check the version on the reference and remove it.

The assemblyBinding redirects are a hack that your top level application applies to make sure that any dependencies that need lower versions forward their calls to the newer version. If THAT is failing, I'm willing to bet your bad reference is in your top level application.

from ecobee.

Perecli avatar Perecli commented on August 23, 2024

I striped my project to nothing. No external assemblies, no nuget packages. No references to Neutonsoft. Nothing but a bare new project with no references added other than your lib and the default .NET references added by VS when creating a new project. I stripped my code down to a ridiculously looking few lines of code just enough to make a call to ecobee server. It still fails. The only conflict left possible is in your lib or within VB.NET itself.

Here is a link to this test harness. I would greatly appreciate it if you could look at it.
https://files.argowin.com/test.zip

from ecobee.

i8beef avatar i8beef commented on August 23, 2024

It appears that this is a known issue that you just have to deal with: https://www.hanselman.com/blog/ReferencingNETStandardAssembliesFromBothNETCoreAndNETFramework.aspx

Basically, if you are referencing a .NET Standard project from a Framework project in a single solution, dependencies do NOT flow the same way they would in an all-framework or all-core solution.

By far your simplest answer is use NuGet here, because it's going to just handle all this for you. Otherwise you should be able to fix this by adding the NuGet reference for Newtonsoft.Json to any calling projects, or jumping though the hoops Scott mentions there of changing your project format, but that seems pretty hairy if you don't have a decent grasp of what it's doing.

from ecobee.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.