Git Product home page Git Product logo

Comments (4)

richardszalay avatar richardszalay commented on May 20, 2024

MockHttp takes a dependency on the System.Net.Http package as opposed to the System.Net.Http GAC assembly that shipped with netfx 4.6.1. This decision was mainly due to the NuGet package being updated regularly, and hence being a stronger long term bet than the GAC assembly.

Your choices are essentially:

  1. Downgrade to MockHttp 1.2.2 in your test project
  2. Move all of your projects (even your non-test ones) to use the System.Net.Http package

from mockhttp.

kevinrjones avatar kevinrjones commented on May 20, 2024

Richard,

thanks for taking your time to reply to this. I've now added the System.Net.Http package to every project in the solution, even those that don't use it, and I'm still getting the same error. I've also tried to fallback to 1.2.2 and I'm getting 2 issues there, the same one with System.Net.Http and also problems trying to install BCL.

I'm wondering if I should clone the repo and build it on 4.6.1 and see if that works.

Thanks again

from mockhttp.

richardszalay avatar richardszalay commented on May 20, 2024

I've just tested:

  1. Creating a simple net461 console app
  2. Install-Package System.Net.Http
  3. Install-Package RichardSzalay.MockHttp
  4. Setting up a basic mock

And it ran as expected. I wonder if one of your assembly references is incorrect. Can you see if you can provide a minimal reproducible code snippet?

from mockhttp.

kevinrjones avatar kevinrjones commented on May 20, 2024

I got to the bottom of the problem and it was my configuration. The project I'm testing and it's a .Net 4.6.1 project, however it references a couple of .Net Standard projects. Making both those .Net 4.6.1 projects fixed the issue.

Thanks for your time

from mockhttp.

Related Issues (20)

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.