I have a legacy ASP.NET MVC application built with .NET Framework 4.8, and I'm unable to use constructors of types with required
members in a .cshtml file. I have installed PolySharp in this project, but I have a feeling something else is required to make it work in .cshtml files.
The error message I'm getting is: 'Constructors of types with required members are not supported in this version of your compiler.'.
Microsoft (R) Visual C# Compiler version 4.1.0-5.22114.11 (260d16a8)
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Projects\MyProject\MyProject.Web.Mvc\Views\Shared\_Layout.cshtml(228,123): error CS0619: 'App.App()' is obsolete: 'Constructors of types with required members are not supported in this version of your compiler.'
<system.codedom>
<compilers>
<compiler extension=".cs" language="c#;cs;csharp" warningLevel="4"
compilerOptions="/langversion:11.0"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<compiler extension=".vb" language="vb;vbs;visualbasic;vbscript" warningLevel="4"
compilerOptions="/langversion:11.0 /define:_MYTYPE=\"Web\" /optionInfer+"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</compilers>
</system.codedom>