nigel-sampson / octokit.caching Goto Github PK
View Code? Open in Web Editor NEWCaching Http Backend for Octokit
License: Apache License 2.0
Caching Http Backend for Octokit
License: Apache License 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.
new CachingHttpClient(new HttpClientAdapter(), new NaiveInMemoryCache()),
…to this, to get it to compile…
new CachingHttpClient(new HttpClientAdapter(() => HttpMessageHandlerFactory.CreateDefault(new WebProxy())), new NaiveInMemoryCache()),
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).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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.