aliostad / CacheCow

An implementation of HTTP Caching in .NET Core and 4.5.2+ for both the client and the server
MIT License
847 stars 172 forks source link

Problems using it in a .NET 5 WebApi project #265

Closed SteveDunn closed 2 years ago

SteveDunn commented 2 years ago

I added the 2.8.3. of CacheCow.Server.WebApi, but I see:

Package 'CacheCow.Server.WebApi 2.8.3' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework 'net5.0'. This package may not be fully compatible with your project.

When I add an HttpCache attribute to an endpoint, it doesn't compile:

Error   CS0012  The type 'ActionFilterAttribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Http, Version=5.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Any ideas?

aliostad commented 2 years ago

Hi,

.NET 5.0 is not yet supported. I will get to this hopefully in the next few days. There are is another issue open around that.

SteveDunn commented 2 years ago

I'm happy to help. Seems like it'd need a new major version for the next release?

aliostad commented 2 years ago

Hi, I have pushed support for .NET 5.0.

Can you please check now? My guess is now this is just reference collision.

aliostad commented 2 years ago

Bear in mind .NET 5.0 binaries have been built with no issue hence it should work for you.