Exception has occurred: CLR/System.MissingMethodException
An exception of type 'System.MissingMethodException' occurred in TravelGuard.WebApi.dll but was not handled in user code: 'Method not found: 'System.Threading.Tasks.Task`1<Byte[]> Microsoft.Extensions.Caching.Distributed.IDistributedCache.GetAsync(System.String)'.'
at Couchbase.Extensions.Caching.CouchbaseCacheServiceCollectionExtensions.AddDistributedCouchbaseCache(IServiceCollection services, Action`1 setupAction)
at TravelGuard.WebApi.Startup.ConfigureServices(IServiceCollection services) in c:\dev\TravelGuard\src\TravelGuard.WebApi\Startup.cs:line 61
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddMvc();
//configure the Couchbase client
services.AddCouchbase(opt =>
{
opt.Servers = new List<Uri>
{
new Uri("http://localhost:8091")
};
});
//configure the cache to use the default bucket
services.AddDistributedCouchbaseCache("default", opt=>{});
}
This doesn’t exactly answer your question, but I would start with updating to the newer beta1 and see if the issue still persists!
@jmorris, sorry for the delay. I did a simple webapi app with dotnet new and added in the couchbase references, and I still get the error. I’ve attached it for your convenience.
Your app is using .NET Core 2.0 - the current Cache and Session implementation only support .NET Core 1.0. It looks like perhaps the IDistributedCache interface may have changed for 2.0, thus the missing method exception.
I know this is all still beta for both couchbase and dotnet core, but are there any plans to support 2.0 in the next few months? dotnet 2.0 is supposed to be released in the 3rd quarter so we’re targeting that for our project, and we’d like to use couchbase. If not, I understand, I’ll just have to make fallback plans.
Again, thanks for helping me troubleshoot this issue.
Daniel
We do plan on supporting dotnet 2.0 and the goal was to have a release available when it goes RTM. That being said, I can’t guarantee an exact date for when this is going to happen.
The actual change seems to be pretty minor, it’s just an interface change for CancellationTokens. I’ll see if I can get a work-around for beta3.