'HttpContext' does not contain a definition for 'GetOwinContext' in c# .net framwork 4.5

Viewed 2088

Hi I'm trying to add OpenID connect and this run this code in application

 protected void btnLoginopenID_Click(object sender, EventArgs e)
    {

        try
        {

            if (!Request.IsAuthenticated)
            {
                //Response.Redirect("~/AccessDenied2.aspx", false);
                HttpContext.Current.GetOwinContext().Authentication.Challenge();
            }


        }
        catch (Exception exception)
        {
        }
    }

and I'm getting this error message when trying to run code

CS1061 'HttpContext' does not contain a definition for 'GetOwinContext' and no extension method 'GetOwinContext' accepting a first argument of type 'HttpContext' could be found

enter image description here

i did try

Install-Package Microsoft.Owin.Host.SystemWeb

but didn't work for me any suggestion to fix t his issue or also if you know any way to integrate OpenID Connect to C# .net framework 4.5 for WebForm.aspx please let me know

1 Answers

it's missing package Microsoft.Owin.Host.SystemWeb

Related