PokeApiNet icon indicating copy to clipboard operation
PokeApiNet copied to clipboard

Any client calls results in error

Open jaymarvels opened this issue 2 years ago • 2 comments

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

jaymarvels avatar Sep 30 '22 13:09 jaymarvels

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.

jtwotimes avatar Oct 02 '22 12:10 jtwotimes

Yeah, that was the exact issue, building it from the source it was missing dependencies which nuget handles all for you, my bad!

jaymarvels avatar Oct 10 '22 09:10 jaymarvels