编译器错误在MVC5更新Microsoft.Aspnet.Identity后 [英] Compiler Errors after updating Microsoft.Aspnet.Identity in MVC5
问题描述
使用Vs2013 preVIEW,我创建了一个C#Web应用程序从对话框中选择MVC和的WebAPI。它编译OK。如果我更新从的NuGet软件包管理器β2版本的引用(包括$ P $租赁前的),则它无法编译。我得到21错误,位于AccountController.cs和IdentityConfig.cs。我试图向updateing这给了同样的错误了最新的夜间库。鸭preciate preVIEW code就是这样所以从模板重新开始。想知道是否有人知道我能避免更新其参考。
Using the Vs2013 preview, i created a c# webapp selecting MVC and WebAPI from the dialog. It compiled ok. If i update the references from the nuget package manager to the beta2 versions (include Prerelease), it then fails to compile. I get 21 errors, located in the AccountController.cs and the IdentityConfig.cs. I tried updateing to the latest nightly libraries which gave the same errors. Appreciate preview code is just that so start again from the template. Was wondering if anyone knew which reference i could avoid updating.
错误1调用下面的方法或模棱两可之间
属性:
Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)'
和
Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)'C:\\用户\\管理\\文档\\ Visual
工作室
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ \\控制器115 AccountController.cs 29 vs2013bootstrap
错误2调用下面的方法或模棱两可之间
属性:
Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)'
和
Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)'C:\\用户\\管理\\文档\\ Visual
工作室
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ \\控制器138 AccountController.cs 64 vs2013bootstrap
错误3调用下面的方法或模棱两可之间
属性:
Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)'
和
Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)'C:\\用户\\管理\\文档\\ Visual
工作室
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ \\控制器151 AccountController.cs 29 vs2013bootstrap
错误4调用下面的方法或模棱两可之间
属性:
Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)'
和
Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)'C:\\用户\\管理\\文档\\ Visual
工作室
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ \\控制器152 AccountController.cs 64 vs2013bootstrap
错误5调用下面的方法或模棱两可之间
属性:
Microsoft.AspNet.Identity.IdentityExtensions.GetUserName(System.Security.Principal.IIdentity)'
和
Microsoft.AspNet.Identity.IdentityExtensions.GetUserName(System.Security.Principal.IIdentity)'C:\\用户\\管理\\文档\\ Visual
工作室
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ \\控制器185 AccountController.cs 41 vs2013bootstrap
错误6调用下面的方法或模棱两可之间
属性:
Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)'
和
Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)'C:\\用户\\管理\\文档\\ Visual
工作室
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ \\控制器249 AccountController.cs 52 vs2013bootstrap
错误7调用下面的方法或模棱两可之间
属性:
Microsoft.AspNet.Identity.IdentityExtensions.FindFirstValue(System.Security.Claims.ClaimsIdentity,
字符串)和
Microsoft.AspNet.Identity.IdentityExtensions.FindFirstValue(System.Security.Claims.ClaimsIdentity,
字符串)C:\\用户\\管理\\文档\\ Visual Studio的
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ \\控制器286 AccountController.cs 86 vs2013bootstrap
错误8调用下面的方法或模棱两可之间
属性:
Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)'
和
Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)'C:\\用户\\管理\\文档\\ Visual
工作室
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ \\控制器338 AccountController.cs 61 vs2013bootstrap
错误9'Microsoft.AspNet.Identity.IUserSecretStore'不包含
对于UpdateSecret',没有扩展方法的定义UpdateSecret
接受类型的第一个参数
Microsoft.AspNet.Identity.IUserSecretStore'可以找到(你
缺少using指令或程序集
参考)C:\\用户\\管理\\文档\\ Visual Studio中
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\控制器\\ AccountController.cs 376 57 vs2013bootstrap
错误10元数据文件C:\\用户\\管理\\文档\\ Visual Studio中
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ BIN \\ vs2013bootstrap.dll
无法找到C:\\用户\\管理\\文档\\ Visual Studio中
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap.Tests \\ CSC vs2013bootstrap.Tests
错误11类型或命名空间名称'DbContextFactory不能
(是否缺少using指令或程序集
参考)C:\\用户\\管理\\文档\\ Visual Studio中
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ App_Start \\ IdentityConfig.cs 32 40 vs2013bootstrap
错误12'UserSecret'之间不明确的引用
Microsoft.AspNet.Identity.EntityFramework.UserSecret和
vs2013bootstrap.Models.UserSecretC:\\用户\\管理\\文档\\ Visual
工作室
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ App_Start \\ IdentityConfig.cs 33 45 vs2013bootstrap
错误13类型或命名空间名称'EFUserSecretStore不能
(是否缺少using指令或程序集
参考)C:\\用户\\管理\\文档\\ Visual Studio中
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ App_Start \\ IdentityConfig.cs 33 27 vs2013bootstrap
错误14用户登陆之间不明确的引用
Microsoft.AspNet.Identity.EntityFramework.UserLogin和
vs2013bootstrap.Models.UserLoginC:\\用户\\管理\\文档\\ Visual
工作室
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ App_Start \\ IdentityConfig.cs 34 43 vs2013bootstrap
错误15类型或命名空间名称'EFUserLoginStore不能
(是否缺少using指令或程序集
参考)C:\\用户\\管理\\文档\\ Visual Studio中
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ App_Start \\ IdentityConfig.cs 34 26 vs2013bootstrap
错误16用户之间不明确的引用
Microsoft.AspNet.Identity.EntityFramework.User和
vs2013bootstrap.Models.UserC:\\用户\\管理\\文档\\ Visual
工作室
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ App_Start \\ IdentityConfig.cs 35 37 vs2013bootstrap
错误17类型或命名空间名称'EFUserStore'找不到
(您缺少一个使用指令或程序集
参考)C:\\用户\\管理\\文档\\ Visual Studio中
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ App_Start \\ IdentityConfig.cs 35 25 vs2013bootstrap
错误18角色之间不明确的引用
Microsoft.AspNet.Identity.EntityFramework.Role和
vs2013bootstrap.Models.RoleC:\\用户\\管理\\文档\\ Visual
工作室
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ App_Start \\ IdentityConfig.cs 36 37 vs2013bootstrap
错误19的UserRole之间不明确的引用
Microsoft.AspNet.Identity.EntityFramework.UserRole和
vs2013bootstrap.Models.UserRoleC:\\用户\\管理\\文档\\ Visual
工作室
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ App_Start \\ IdentityConfig.cs 36 43 vs2013bootstrap
错误20类型或命名空间名称'EFRoleStore'找不到
(您缺少一个使用指令或程序集
参考)C:\\用户\\管理\\文档\\ Visual Studio中
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ App_Start \\ IdentityConfig.cs 36 25 vs2013bootstrap
错误21调用下面的方法或模棱两可之间
属性:
Microsoft.AspNet.Identity.IdentityExtensions.FindFirstValue(System.Security.Claims.ClaimsIdentity,
字符串)和
Microsoft.AspNet.Identity.IdentityExtensions.FindFirstValue(System.Security.Claims.ClaimsIdentity,
字符串)C:\\用户\\管理\\文档\\ Visual Studio的
2013 \\项目\\ vs2013bootstrap \\ vs2013bootstrap \\ App_Start \\ IdentityConfig.cs 95 24 vs2013bootstrap
Error 1 The call is ambiguous between the following methods or properties: 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)' and 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)' C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\Controllers\AccountController.cs 115 29 vs2013bootstrap Error 2 The call is ambiguous between the following methods or properties: 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)' and 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)' C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\Controllers\AccountController.cs 138 64 vs2013bootstrap Error 3 The call is ambiguous between the following methods or properties: 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)' and 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)' C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\Controllers\AccountController.cs 151 29 vs2013bootstrap Error 4 The call is ambiguous between the following methods or properties: 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)' and 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)' C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\Controllers\AccountController.cs 152 64 vs2013bootstrap Error 5 The call is ambiguous between the following methods or properties: 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserName(System.Security.Principal.IIdentity)' and 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserName(System.Security.Principal.IIdentity)' C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\Controllers\AccountController.cs 185 41 vs2013bootstrap Error 6 The call is ambiguous between the following methods or properties: 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)' and 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)' C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\Controllers\AccountController.cs 249 52 vs2013bootstrap Error 7 The call is ambiguous between the following methods or properties: 'Microsoft.AspNet.Identity.IdentityExtensions.FindFirstValue(System.Security.Claims.ClaimsIdentity, string)' and 'Microsoft.AspNet.Identity.IdentityExtensions.FindFirstValue(System.Security.Claims.ClaimsIdentity, string)' C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\Controllers\AccountController.cs 286 86 vs2013bootstrap Error 8 The call is ambiguous between the following methods or properties: 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)' and 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserId(System.Security.Principal.IIdentity)' C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\Controllers\AccountController.cs 338 61 vs2013bootstrap Error 9 'Microsoft.AspNet.Identity.IUserSecretStore' does not contain a definition for 'UpdateSecret' and no extension method 'UpdateSecret' accepting a first argument of type 'Microsoft.AspNet.Identity.IUserSecretStore' could be found (are you missing a using directive or an assembly reference?) C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\Controllers\AccountController.cs 376 57 vs2013bootstrap Error 10 Metadata file 'C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\bin\vs2013bootstrap.dll' could not be found C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap.Tests\CSC vs2013bootstrap.Tests Error 11 The type or namespace name 'DbContextFactory' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\App_Start\IdentityConfig.cs 32 40 vs2013bootstrap Error 12 'UserSecret' is an ambiguous reference between 'Microsoft.AspNet.Identity.EntityFramework.UserSecret' and 'vs2013bootstrap.Models.UserSecret' C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\App_Start\IdentityConfig.cs 33 45 vs2013bootstrap Error 13 The type or namespace name 'EFUserSecretStore' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\App_Start\IdentityConfig.cs 33 27 vs2013bootstrap Error 14 'UserLogin' is an ambiguous reference between 'Microsoft.AspNet.Identity.EntityFramework.UserLogin' and 'vs2013bootstrap.Models.UserLogin' C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\App_Start\IdentityConfig.cs 34 43 vs2013bootstrap Error 15 The type or namespace name 'EFUserLoginStore' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\App_Start\IdentityConfig.cs 34 26 vs2013bootstrap Error 16 'User' is an ambiguous reference between 'Microsoft.AspNet.Identity.EntityFramework.User' and 'vs2013bootstrap.Models.User' C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\App_Start\IdentityConfig.cs 35 37 vs2013bootstrap Error 17 The type or namespace name 'EFUserStore' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\App_Start\IdentityConfig.cs 35 25 vs2013bootstrap Error 18 'Role' is an ambiguous reference between 'Microsoft.AspNet.Identity.EntityFramework.Role' and 'vs2013bootstrap.Models.Role' C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\App_Start\IdentityConfig.cs 36 37 vs2013bootstrap Error 19 'UserRole' is an ambiguous reference between 'Microsoft.AspNet.Identity.EntityFramework.UserRole' and 'vs2013bootstrap.Models.UserRole' C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\App_Start\IdentityConfig.cs 36 43 vs2013bootstrap Error 20 The type or namespace name 'EFRoleStore' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\App_Start\IdentityConfig.cs 36 25 vs2013bootstrap Error 21 The call is ambiguous between the following methods or properties: 'Microsoft.AspNet.Identity.IdentityExtensions.FindFirstValue(System.Security.Claims.ClaimsIdentity, string)' and 'Microsoft.AspNet.Identity.IdentityExtensions.FindFirstValue(System.Security.Claims.ClaimsIdentity, string)' C:\Users\Administrator\Documents\Visual Studio 2013\Projects\vs2013bootstrap\vs2013bootstrap\App_Start\IdentityConfig.cs 95 24 vs2013bootstrap
更新
如果我从头开始用相同的模板,并更新只是MVC和的WebAPI库5.0.0-β2(或剃刀的情况3.0.3-β2)启动。然后我的应用程序仍然编译。其中我还没有应用更新是那些都加盖1.1.0-β2并命名为启动Microsoft.Owin.Security
UPDATE If i start from scratch with the same template, and update just the MVC and the WEBAPI libraries to 5.0.0-beta2 (or 3.0.3-beta2 in the case of Razor). then my application still compiles. The updates which i havent applied are those which are all stamped with 1.1.0-beta2 and are named starting Microsoft.Owin.Security
UPDATE2
如果我再加入所有的Owin安全引用它仍然编译。留下两个库
UPDATE2 if i then add all the Owin security references it still compiles. Leaving two libraries
- Microsoft.Aspnet.Identity.Core这是目前1.0.0-出Alpha1-(更新1.0.0-β1)
- Microsoft.AspNet.Identity.EntityFramework这是目前1.0.0-出Alpha1-(更新1.0.0-β1)。
如果我更新的第一个库我得到上面的大胆的错误,如果我再更新第二我得到所有其他错误。
If i update the first library i get the above bold error, if i then update the second i get all the other errors.
所以出现这些更新是不与其他测试版的更新兼容。
So appears these updates aren't compatible with the other beta updates.
推荐答案
想我终于找到了它的资源<一个href=\"http://blogs.msdn.com/b/webdev/archive/2013/06/27/introducing-asp-net-identity-membership-system-for-asp-net-applications.aspx\"相对=nofollow称号=答案>答案这一点。有一个asp.net/vs2013刷新该更新模板身份的beta preVIEW并消除了重大更改
Think i have finally found the resource which answers this. There is an asp.net/vs2013 refresh which updates the templates to the beta preview of Identity and removes the breaking changes
这篇关于编译器错误在MVC5更新Microsoft.Aspnet.Identity后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!