Q:

Caching does not exist in namespace Microsoft.Extensions

I am moving some logic from a micro service to a azure function.
Things are going pretty smoothly, however I have run into a dependency issue. I had some caching features in the micro service that I would like to keep in the azure function, however the function project will not build because it cannot resolve Microsoft.Extensions.Caching.Memory namespace.
I installed Microsoft.Extensions.DependencyInjection via nuget in the new function project so that I could use DI in this function app. I think this is the reason why Microsoft.Extensions.Caching is no longer resolving. 
The error is the common: The type or namespace 'Caching' does not exist in the namespace 'Microsoft.Extensions'
Shouldn't they both be exposed under Microsoft.Extensions namespace?
Does anyone have any idea how to resolve this?
Thanks
EDIT: Some code samples. 
Function Code:
(DI setup is almost exactly this)
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.WebJobs.Host;
using PI.Warehouses.API.Repositories;
using ESPIWarehouseFunction.Injection;

namespace ESPIWarehouseFunction
{
    public static class WarehouseFunctions
    {

        [FunctionName("GetAll")]
        public static IActionResult Run([HttpTrigger(AuthorizationLevel.Function, "get", Route = null)]HttpRequest req, 
            TraceWriter log, [Inject(typeof(IWarehouseStateRepository))]IWarehouseStateRepository repoW)
        {
            log.Info("GetAll Function is processing a request");
            var warehouses = repoW.GetAllWarehouses();
            return warehouses != null ? 
                (ActionResult)new OkObjectResult(warehouses) :
                new BadRequestObjectResult("Something went wrong with this request");
        }
    }
}

One of many code pieces that uses the cache:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Threading;
using MediatR;
using PI.Warehouses.Domain.Aggregate.Commands;
using PI.Warehouses.Domain.Aggregate.Events;
using PI.Warehouses.Domain.Model;
using PI.Warehouses.API.Repositories;
using Newtonsoft.Json;
using PI.Warehouses.Domain.Aggregate.Exceptions;
using Microsoft.Extensions.Caching.Memory;

namespace PI.Warehouses.API.Application.Handlers.Commands
{
    public class AddMaterialHandler : IRequestHandler<AddMaterialCommand, EventList>
    {
        private readonly IEventRepository _repoEvents;
        private readonly IWarehouseStateRepository _repoWarehouse;
        private readonly IMediator _mediator;
        private IMemoryCache _cache;
        private EventList _eventsCreated;

        public AddMaterialHandler(IEventRepository repoE, IWarehouseStateRepository repoW, IMediator mediator, IMemoryCache cache)
        {
            _repoEvents = repoE;
            _repoWarehouse = repoW;
            _mediator = mediator;
            _cache = cache;
            _eventsCreated = new EventList();
        }

            // some setups stuffs ...

            WarehouseState state;
            if (!_cache.TryGetValue(cmd.WarehouseId, out WarehouseState cachedState))
                state = await _repoWarehouse.GetWarehouseState(cmd.WarehouseId);
            else
                state = new WarehouseState(cachedState);

            // Rest of this handler
    }
}

A:

I just created a clean function and installed both packages, I used interfaces from both of them(so I have both usings) and all seems to work correctly:
using System.Collections;
using System.Collections.Generic;
using System.IO;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using Microsoft.Extensions.Logging;

namespace FunctionApp1
{
    public static class Function1
    {
        [FunctionName("Function1")]
        public static IActionResult Run([HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]HttpRequest req, ILogger log)
        {
            log.LogInformation("C# HTTP trigger function processed a request.");

            string name = req.Query["name"];

            string requestBody = new StreamReader(req.Body).ReadToEnd();
            dynamic data = JsonConvert.DeserializeObject(requestBody);
            name = name ?? data?.name;

            return name != null
                ? (ActionResult)new OkObjectResult($"Hello, {name}")
                : new BadRequestObjectResult("Please pass a name on the query string or in the request body");
        }

        public class MyCache : IMemoryCache
        {
            public void Dispose()
            {
                throw new System.NotImplementedException();
            }

            public bool TryGetValue(object key, out object value)
            {
                throw new System.NotImplementedException();
            }

            public ICacheEntry CreateEntry(object key)
            {
                throw new System.NotImplementedException();
            }

            public void Remove(object key)
            {
                throw new System.NotImplementedException();
            }
        }

        public class ServicesCollection : IServiceCollection
        {
            public IEnumerator<ServiceDescriptor> GetEnumerator()
            {
                throw new System.NotImplementedException();
            }

            IEnumerator IEnumerable.GetEnumerator()
            {
                return GetEnumerator();
            }

            public void Add(ServiceDescriptor item)
            {
                throw new System.NotImplementedException();
            }

            public void Clear()
            {
                throw new System.NotImplementedException();
            }

            public bool Contains(ServiceDescriptor item)
            {
                throw new System.NotImplementedException();
            }

            public void CopyTo(ServiceDescriptor[] array, int arrayIndex)
            {
                throw new System.NotImplementedException();
            }

            public bool Remove(ServiceDescriptor item)
            {
                throw new System.NotImplementedException();
            }

            public int Count { get; }
            public bool IsReadOnly { get; }
            public int IndexOf(ServiceDescriptor item)
            {
                throw new System.NotImplementedException();
            }

            public void Insert(int index, ServiceDescriptor item)
            {
                throw new System.NotImplementedException();
            }

            public void RemoveAt(int index)
            {
                throw new System.NotImplementedException();
            }

            public ServiceDescriptor this[int index]
            {
                get => throw new System.NotImplementedException();
                set => throw new System.NotImplementedException();
            }
        }
    }
}

Without a sample from your code it will be hard to diagnose the real issue.
EDIT: 
Here is my .csproj for a project:
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <AzureFunctionsVersion>v2</AzureFunctionsVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.1.2" />
    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.14" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
</Project>

