PokeApiNet
PokeApiNet copied to clipboard
Any client calls results in error
I have pulled down the repo, ran a rebuild and then referenced the built dll into a .net framework 4.8 project.
Added this is as test:
var client = new HttpClient();
var pokiclient = new PokeApiClient(client);
var xx = pokiclient.GetResourceAsync<Pokemon>("ho-oh").Result;
And currently get this error:
System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.Extensions.Caching.Memory, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.'
This happens in the resource cache manager here:
/// <summary>
/// Constructor
/// </summary>
public ResourceCacheManager()
{
// TODO allow configuration of experiation policies
_resourceCaches = ResourceTypes.ToImmutableDictionary(x => x, _ => new ResourceCache());
}
I have tried other client methods and all result in the same error
Does the same error happen when the nuget package is used instead of the dll? I suspect this is due to differences in how dependencies are resolved between nuget packages and dll files.
Yeah, that was the exact issue, building it from the source it was missing dependencies which nuget handles all for you, my bad!