title: Package 'Microsoft.AspNet.Mvc 5.2.7' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7,
body: <p>I want to migrate from my ASP.NET Framework MVC project(.NET Framework 4.7) to ASP.NET Core MVC project(.NET 5.0). In the solution there are some class libraries.
  In one of class libraries there is following class:</p>
  <pre><code>namespace Framework
  {
      public class AtisunAuthorize : AuthorizeAttribute
      {
          protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
          {
              var integratedAuthentication = this.GetAppSetting&lt;bool&gt;(&quot;IntegratedAuthentication&quot;);
              if (!integratedAuthentication)
              {
                  base.HandleUnauthorizedRequest(filterContext);
                  return;
              }
              var loginUrl = this.GetAppSetting&lt;string&gt;(&quot;UMSLogInUrl&quot;);
              if(string.IsNullOrWhiteSpace(loginUrl))
              {
                  throw new AtiSunException(&quot;&quot;);
              }
              var returnUrl = HttpUtility.UrlEncode(filterContext.HttpContext.Request.Url.AbsoluteUri);
              filterContext.Result = new RedirectResult(loginUrl + &quot;?ReturnUrl=&quot; + returnUrl);
          }
      }
  }
  </code></pre>
  <p>I install &quot;System.Web.Mvc&quot; from nuget and then I catch following warning and error:</p>
  <p>1- warning:</p>
  <blockquote>
  <p>Package 'Microsoft.AspNet.Mvc 5.2.7' 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.</p>
  </blockquote>
  <p>2- error int the following line:</p>
  <pre><code>var returnUrl = HttpUtility.UrlEncode(filterContext.HttpContext.Request.Url.AbsoluteUri);
  </code></pre>
  <p>How Can I solve this problem? Any help will be appriciated.</p>