Suppress obsolete warnings

This commit is contained in:
Pranav K 2018-07-31 11:06:30 -07:00
parent 52d5164db8
commit e094d2579e
No known key found for this signature in database
GPG Key ID: 1963DA6D96C3057A
3 changed files with 6 additions and 2 deletions

View File

@ -6,8 +6,8 @@
<InternalAspNetCoreSdkPackageVersion>2.2.0-preview1-17102</InternalAspNetCoreSdkPackageVersion>
<MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>2.2.0-preview1-34823</MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>
<MicrosoftAspNetCoreHostingPackageVersion>2.2.0-preview1-34823</MicrosoftAspNetCoreHostingPackageVersion>
<MicrosoftAspNetCoreMvcPackageVersion>2.2.0-preview1-34823</MicrosoftAspNetCoreMvcPackageVersion>
<MicrosoftAspNetCoreMvcRazorPagesPackageVersion>2.2.0-preview1-34823</MicrosoftAspNetCoreMvcRazorPagesPackageVersion>
<MicrosoftAspNetCoreMvcPackageVersion>2.2.0-a-preview1-obs-18917</MicrosoftAspNetCoreMvcPackageVersion>
<MicrosoftAspNetCoreMvcRazorPagesPackageVersion>2.2.0-a-preview1-obs-18917</MicrosoftAspNetCoreMvcRazorPagesPackageVersion>
<MicrosoftAspNetCoreRazorDesignPackageVersion>2.2.0-preview1-34823</MicrosoftAspNetCoreRazorDesignPackageVersion>
<MicrosoftAspNetCoreRazorRuntimePackageVersion>2.2.0-preview1-34823</MicrosoftAspNetCoreRazorRuntimePackageVersion>
<MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>0.6.0-preview1-34823</MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>

View File

@ -179,7 +179,9 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal
// Post process the compilation - run ExpressionRewritter and any user specified callbacks.
compilation = ExpressionRewriter.Rewrite(compilation);
var compilationContext = new RoslynCompilationContext(compilation);
#pragma warning disable CS0618 // Type or member is obsolete
MvcServiceProvider.ViewEngineOptions.CompilationCallback(compilationContext);
#pragma warning restore CS0618 // Type or member is obsolete
compilation = AssemblyMetadataGenerator.AddAssemblyMetadata(
compiler,
compilationContext.Compilation,

View File

@ -29,8 +29,10 @@ namespace ApplicationWithConfigureStartup
{
builder.AddRazorOptions(options =>
{
#pragma warning disable CS0618 // Type or member is obsolete
var callback = options.CompilationCallback;
options.CompilationCallback = context =>
#pragma warning restore CS0618 // Type or member is obsolete
{
callback(context);
foreach (var tree in context.Compilation.SyntaxTrees)