0

我在 Windows Store App 中使用 Bcrypt.net 哈希处理密码。在 Windows 平板电脑中构建和测试时,它工作正常。但是,当我尝试上传此应用程序进行存储时,它在受支持的 API 测试中失败。

给出了以下错误详细信息

此应用程序类型不支持 MSCORLIB 中的 API System.ApplicationException,PUBLICKEYTOKEN=B77A5C561934E089。BCrypt.Net.dll 调用此 API。

API System.Runtime.Serialization.SerializationInfo in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. BCrypt.Net.dll calls this API.
API System.Security.Cryptography.RandomNumberGenerator in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. BCrypt.Net.dll calls this API.
API System.ApplicationException.#ctor in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. BCrypt.Net.dll calls this API.
API System.ApplicationException.#ctor(System.String) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. BCrypt.Net.dll calls this API.
API System.ApplicationException.#ctor(System.String,System.Exception) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. BCrypt.Net.dll calls this API.
API System.ApplicationException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. BCrypt.Net.dll calls this API.
API System.Text.StringBuilder.AppendFormat(System.String,System.Object) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. BCrypt.Net.dll calls this API.
API System.Security.Cryptography.RandomNumberGenerator.Create in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. BCrypt.Net.dll calls this API.
API System.Security.Cryptography.RandomNumberGenerator.GetBytes(System.Byte[]) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. BCrypt.Net.dll calls this API.

为此可以做些什么?有任何想法吗?提前致谢。

4

2 回答 2

2

如错误消息所述

此应用程序类型不支持 MSCORLIB 中的 API System.Runtime.Serialization.SerializationInfo,PUBLICKEYTOKEN=B77A5C561934E089。BCrypt.Net.dll 调用此 API。

SerializationInfo 类不属于Store App 的 .NET

您不能在商店应用程序开发中使用 BCrypt.NET,因为它是基于完整的 .NET 构建的,我建议您在 Windows 运行时应用程序中使用HashAlgorithmProvider 类。

于 2015-07-15T05:54:27.770 回答
1

我知道这有点晚了,但我已经将 BCrypt.net 移植到 .net Core,所以你现在应该可以使用它了。只需将您的依赖项换成此处的依赖项:

https://www.nuget.org/packages/BCrypt.Net-Core/

它应该是替换的下降。

于 2016-01-30T18:32:32.990 回答