Currently, HttpResponseBase.Cache is typed as HttpCachePolicy. It should be HttpCachePolicyBase (a type that doesn't yet exist in SystemWebAdapters). See referencesource
To Reproduce
// in .netstandard2.0 library
public void TestMethod()
{
HttpResponseBase responseBase = new HttpResponseWrapper(HttpContext.Current.Response);
responseBase.Cache.SetCacheability(HttpCacheability.NoCache);
}
// In ASP.NET Framework application
TestMethod();
Exceptions (if any)
System.MissingMethodException: Method not found: 'System.Web.HttpCachePolicy System.Web.HttpResponseBase.get_Cache()'.
Describe the bug
Currently,
HttpResponseBase.Cache
is typed asHttpCachePolicy
. It should beHttpCachePolicyBase
(a type that doesn't yet exist in SystemWebAdapters). See referencesourceTo Reproduce
Exceptions (if any)
System.MissingMethodException: Method not found: 'System.Web.HttpCachePolicy System.Web.HttpResponseBase.get_Cache()'.
This exception happens at runtime.