Merge remote-tracking branch 'origin/rel/2.0.0' into dev

This commit is contained in:
Javier Calvarro Nelson 2017-07-10 18:22:09 -07:00
commit 9c33cc2eda
2 changed files with 7 additions and 4 deletions

View File

@ -12,7 +12,7 @@
<MoqVersion>4.7.49</MoqVersion>
<NETStandardImplicitPackageVersion>2.0.0-*</NETStandardImplicitPackageVersion>
<NETStandardLibraryNETFrameworkVersion>2.0.0-*</NETStandardLibraryNETFrameworkVersion>
<RoslynVersion>2.3.0-beta3-*</RoslynVersion>
<RoslynVersion>2.3.0-beta4-*</RoslynVersion>
<RuntimeFrameworkVersion Condition="'$(TargetFramework)'=='netcoreapp2.0'">2.0.0-*</RuntimeFrameworkVersion>
<TestSdkVersion>15.3.0-*</TestSdkVersion>
<WebApiClientVersion>5.2.2</WebApiClientVersion>

View File

@ -119,8 +119,8 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
// Use the CreateEntry to ensure a cache scope is created that will copy expiration tokens from
// cache entries created from the GetChildContentAsync call to the current entry.
IHtmlContent content;
using (var entry = MemoryCache.CreateEntry(cacheKey))
{
var entry = MemoryCache.CreateEntry(cacheKey);
// The result is processed inside an entry
// such that the tokens are inherited.
@ -130,9 +130,12 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
entry.SetOptions(options);
entry.Value = result;
}
tcs.SetResult(content);
// An entry gets committed to the cache when disposed gets called. We only want to do this when
// the content has been correctly generated (didn't throw an exception). For that reason the entry
// can't be put inside a using block.
entry.Dispose();
return content;
}
catch (Exception ex)