Unable to access SixLabors.ImageSharp.Web.Caching.Azure namespace
dewnyc opened this issue · 2 comments
Prerequisites
- I have written a descriptive issue title
- I have verified that I am running the latest version of ImageSharp.Web
- I have verified if the problem exist in both
DEBUG
andRELEASE
mode - I have searched open and closed issues to ensure it has not already been reported
ImageSharp.Web version
2.0.2
Other Six Labors packages and versions
SixLabors.ImageSharp 3.0.0
Environment (Operating system, version and so on)
Windows 10, Episerver.CMS 12.13.2
.NET Framework version
6
Description
I am using this with Baaijte.Optimizely.ImageSharp.Web but I have added ImageSharp.Web separately to another program and saw similar results.
I got errors about being unable to find AzureBlobStorageCacheOptions and AzureBlobStorageCache after I added the following code to the ConfigureServices method in my Startup.cs file:
services.AddImageSharp()
.Configure<AzureBlobStorageCacheOptions>(options =>
{
options.ConnectionString = _configuration.GetConnectionString("EPiServerAzureBlobs");
options.ContainerName = "mysitemedia";
})
.ClearProviders()
.AddProvider<BlobImageProvider>()
.SetCache<AzureBlobStorageCache>();
I tried adding "using SixLabors.ImageSharp.Web.Caching.Azure;" but also got an error there.
From what I read on Optimizely forums, it looks like these classes used to be in SixLabors.ImageSharp.Web.Providers.Azure but adding a using statement with that did not work for me either.
I am able to work around this issue by copying the code for these files into my project:
AzureBlobStorageCache.cs
AzureBlobStorageCacheOptions.cs
AzureBlobStorageCacheResolver.cs
IAzureBlobContainerClientOptions.cs
Steps to Reproduce
Install ImageSharp.Web NuGet package to a new project.
Try adding either of these lines to a .cs file:
using SixLabors.ImageSharp.Web.Caching.Azure;
using SixLabors.ImageSharp.Web.Providers.Azure;
Images
No response
@dewnyc that provider is in the SixLabors.ImageSharp.Web.Providers.Azure package make sure you add that as a dependency.
Other Six Labors packages and versions
SixLabors.ImageSharp 3.0.0
Please also be aware that ImageSharp v3.0.0 contains binary breaking changes which are not compatible with ImageSharp.Web v2.0.2. You must use ImageSharp v2.1.3 at this point until a new ImageSharp.Web version is released.