[英]The type or namespace 'GenericPrincipal' could not be found ASP.NET C#
Add using System.Security.Principal
to the top. using System.Security.Principal
添加到顶部。
In Visual Studio 2015 (maybe other versions too), if you see a squiggly line, you can put the cursor over the squiggly line, and then press: 在Visual Studio 2015中 (可能还有其他版本),如果看到一条弯曲的线,可以将光标放在弯曲的线上,然后按:
CTRL + .
and Visual Studio will show you a bunch of options to fix the issue. 并且Visual Studio将为您显示许多解决此问题的选项。 One option shown for the above case would be to add
using System.Security.Principal
and you simply select the option. 针对上述情况显示的一个选项是
using System.Security.Principal
添加,您只需选择该选项即可。 And that will fix it. 这将解决它。 This is a very useful tool and every developer should be aware of it.
这是一个非常有用的工具,每个开发人员都应该意识到这一点。 Of course, you can add the
using System.Security.Principal
manually too; 当然,您也可以手动添加
using System.Security.Principal
。 just by typing it. 只需输入即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.