Shazwazza/UmbracoIdentity

type or namespace name 'UmbracoMembersUserManager<>' could not be found

cdecinkoKnight opened this issue · 6 comments

Clean creation of a .NET project. Added Umbraco 7.14 via NuGet with default starter kit. Site runs with no errors as expected. Installed UmbracoIdentity via NuGet. Now, cannot even build the project, getting 12 of this error:

The type or namespace name 'UmbracoMembersUserManager<>' could not be found (are you missing a using directive or an assembly reference?)

I cannot replicate.

  • I create a new ASP.Net Framework 4.5.2 project in VS, with 'empty' (no mvc, etc..)
  • I install nuget package: Install-Package UmbracoCms -Version 7.14.0
  • Start the site and run the installer
  • I install nuget package 'Install-Package UmbracoIdentity`
  • Start the site, everything works

what are you doing differently and do you have more information? Maybe you are using a 'website' instead of a 'web app' ? Or maybe you've named your project (and thus your default namespace) to something that conflicts with the default namespace in UmbracoIdentity.

Not sure what is wrong. Using Visual Studio 2017. I do the exact steps above. Before I was using .Net 4.7 so I chose 4.5.2 this time. On the second build/restart I get errors that UmbracoMembersUserManager and UmbracoMembersRoleManager cannot be found. I can fix that by allowing using UmbracoIdentity to be added to the controller. But then I get an error about an ambiguous call to GetUserId. It doesn't know to use the Microsoft version or the UmbracoIdentity version.

image

maybe you can post the code in that controller here? I can't replicate the issue sorry

RIght, i think i've been able to replicate, will see what i can do

The problem is for some reason that there's ambiguity between microsoft's extension methods and the one shipped with UmbracoIdentity, perhaps this is caused by some owin updates or something along the way.

You can fix this yourself now by just using the MS extensions explicitly so in your UmbracoIdentityAccountController replace all instances of User.Identity.GetUserId<int>() with Microsoft.AspNet.Identity.IdentityExtensions.GetUserId<int>(User.Identity)

I'll get a new release out that fixes this though.