Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 421 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'Microsoft.Owin.IOwinContext' does not contain a definition for 'GetUserManager' and no extension method?

#1
The following code is copied from the Asp.Net Identity 2.0 sample.

private ApplicationUserManager _userManager;
public ApplicationUserManager UserManager
{
get
{
return // Error
_userManager ?? HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>();
}
private set
{
_userManager = value;
}
}

However it gets the following error?

> Error 3 'Microsoft.Owin.IOwinContext' does not contain a definition for 'GetUserManager' and no extension method 'GetUserManager' accepting a first argument of type 'Microsoft.Owin.IOwinContext' could be found (are you missing a using directive or an assembly reference?)

**Update:**

The version 2 of Microsoft.AspNet.Identity.Owin.dll already exists in ...\packages\Microsoft.AspNet.Identity.Owin.2.0.1\lib\net45.

However, the view definition of `HttpContext.GetOwinContext()` are different between my project and the sample. The first three lines of my project are

<pre>
#region Assembly Microsoft.Owin.Host.SystemWeb.dll, v2.0.0.0
// C:\......\packages\Microsoft.Owin.Host.SystemWeb.2.0.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll
#endregion
</pre>

while the sample is

<pre>
#region Assembly Microsoft.Owin.Host.SystemWeb.dll, v2.1.0.0
// C:\....\sample\packages\Microsoft.Owin.Host.SystemWeb.2.1.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll
#endregion
</pre>

But I already updated all Owin Nuget packages to the newest version using Neget.
Reply

#2
The extension method was moved to a different namespace, try adding

using Microsoft.AspNet.Identity.Owin;
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through