GithubHelp home page GithubHelp logo

octokit.caching's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

octokit.caching's Issues

Making things work with .NET Core 2.0

I don't know if there are plans to migrate to supporting .NET Core (or .NET Standard), but I found that when I tried to use this library in a .NET Core 2.0 console app in Visual Studio for Mac, I ran into a few issues.

  1. In the usage example, I had to adapt this line…
new CachingHttpClient(new HttpClientAdapter(), new NaiveInMemoryCache()),

…to this, to get it to compile…

new CachingHttpClient(new HttpClientAdapter(() => HttpMessageHandlerFactory.CreateDefault(new WebProxy())), new NaiveInMemoryCache()),
  1. [The bigger issue.] When I actually ran the program, even without any use of the Connection instance just created, it will crash the console app without any exception details or mention of what the exception was in the program output (at least in Visual Studio for Mac).

Potential problem

I don't know the exact issue without any exception details, but I suspect it's some sort of assembly mismatch somewhere, since it did warn about the package being "restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. "

Unfortunately, running the solution with the source cloned and a direct project reference to try to debug, it still failed silently.

Potential solution

To get things debug-friendly, I spun up a new .NET Standard 2.0 project, added a reference to Microsoft.Net.Http and Octokit, and updated the IHttpClient implementation to include the new Dispose and SetRequestTimeout methods.

Once I had that, everything built fine, and my destination project started working without any issues.

The source for the .NET Standard project is in a branch on my fork. I can also port the various required code updates to the .NET Framework projects, but maybe the .NET Standard option would work going forward for multiple consuming frameworks.

If a pull request would be helpful, let me know. From there, I can try to make any other changes needed to go make it merge-worthy. For example, the Octokit.Caching.Tests and Octokit.Caching-NetCore45 projects do not load on Visual Studio for Mac, so I haven't even run those tests yet.

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.