我下载了2015年的visual studio社区.我试图创建一个共享项目并收到错误:
来自Microsoft.Windows.UI.Xaml.CSharp.targets的内容
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(TargetPlatformVersion)'==''">
<TargetPlatformVersion>8.0</TargetPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetPlatformIdentifier)' == 'UAP'">
<RedirectionTarget>8.2</RedirectionTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(RedirectionTarget)' == ''">
<RedirectionTarget>$(TargetPlatformVersion)</RedirectionTarget>
</PropertyGroup>
<!-- Direct 8.0 projects to 8.1 targets to enable retargeting -->
<PropertyGroup Condition="'$(RedirectionTarget)' == '8.0'">
<RedirectionTarget>8.1</RedirectionTarget>
</PropertyGroup>
<Import Project="$(RedirectionTarget)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
</Project>
Run Code Online (Sandbox Code Playgroud)
我没有名称为8.1的文件夹
我有两个型号1)
public class Indicator
{
public long ID { get; set; }
public string Name { get; set; }
public int MaxPoint { get; set; }
public string Comment { get; set; }
public DateTime DateChanged { get; set; }
public DateTime DateCreated { get; set; }
public virtual IList<CalculationType> CalculationTypes { get; set; }
public virtual IList<TestEntity> TestEntitys { get; set; }
public virtual IndicatorGroup IndicatorGroup { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
2)
public class CalculationType
{
public long ID …Run Code Online (Sandbox Code Playgroud) 我实现了IPasswordHasher
public class MyPasswordHasher : IPasswordHasher
{
public string HashPassword(string password)
{
using (SHA256 mySHA256 = SHA256Managed.Create())
{
byte[] hash = mySHA256.ComputeHash(Encoding.UTF8.GetBytes(password.ToString()));
StringBuilder hashSB = new StringBuilder();
for (int i = 0; i < hash.Length; i++)
{
hashSB.Append(hash[i].ToString("x2"));
}
return hashSB.ToString();
}
}
public PasswordVerificationResult VerifyHashedPassword(
string hashedPassword, string providedPassword)
{
if (hashedPassword == HashPassword(providedPassword))
return PasswordVerificationResult.Success;
else
return PasswordVerificationResult.Failed;
}
}
Run Code Online (Sandbox Code Playgroud)
我在IdentityConfig中写道
manager.PasswordHasher = new MyPasswordHasher();
Run Code Online (Sandbox Code Playgroud)
但var user = await UserManager.FindAsync(model.Email, model.Password);在AccountController/Login中不要使用MyPasswordHaser.
我怎样才能在身份2.1中使用它?
我对异步 IO 操作感到困惑。在本文中中,Stephen Cleary 解释说我们不应该使用,Task.Run(() => SomeIoMethod())因为真正的异步操作应该使用
\n\n\n.NET 中的标准 P/Invoke 异步 I/O 系统
\n
http://blog.stephencleary.com/2013/11/there-is-no-thread.html
\n\n\n\n\n但是,请避免在库中使用 \xe2\x80\x9c 伪造异步\xe2\x80\x9d。假异步是指组件具有异步就绪 API,但它只是通过将同步 API 包装在线程池线程中来实现。这对于 ASP.NET 的可扩展性来说会适得其反。假异步的一个突出例子是 Newtonsoft JSON.NET,这是一个优秀的库。最好不要调用(假)异步版本来序列化 JSON;只需调用同步版本即可。假异步的一个更棘手的例子是 BCL 文件流。当打开文件流时,必须显式打开它以进行异步访问;否则,它将使用假异步,同步阻塞\n线程池线程对文件的读写。
\n
他建议使用 HttpClient 但内部使用Task.Factory.StartNew()\n
这是否意味着它HttpClient不提供真正的异步操作?
我有一个没有注册的项目.管理员在admin中注册用户.该项目没有角色,我只有一种类型的用户.我不需要"AspNetRoles","AspNetUserClaims","AspNewUserLogins","AspNetUserRoles".在"AspNetUsers"表中我只需要"Id","Email","Password"和一些自定义属性.在mvc 5中实现这个的最佳方法是什么?