小编Aha*_*V P的帖子

System.PlatformNotSupportedException:'此平台不支持此操作.' 将ServiceStack升级到.netcore 2.0时

我们正在使用ServiceStack(.netcore)作为我们的Web服务层,在一个尚未上线的开源项目中.我们计划迁移到.netcore2.0.我们于11月17日从https://github.com/ServiceStack/ServiceStack下载了servicestacks的master分支进行测试.但是由于以下异常我们陷入困境,servicestack项目没有启动.

我们对此做了一些研究,发现.Net Core没有toXmlString()和fromXmlString方法.请参阅https://github.com/dotnet/core/issues/874https://github.com/dotnet/corefx/issues/23686.

需要来自servicestack社区的帮助.

$exception {System.PlatformNotSupportedException: Operation is not supported on this platform. at System.Security.Cryptography.RSA.FromXmlString(String xmlString) at ServiceStack.RsaUtils.ToPrivateRSAParameters(String privateKeyXml) in F:\ExpressBase\ExpressBase.Core\ServiceStack.Core\ServiceStack.Client\CryptUtils.cs:line 85 at ServiceStack.Auth.JwtAuthProviderReader.set_PrivateKeyXml(String value) in F:\ExpressBase\ExpressBase.Core\ServiceStack.Core\ServiceStack\Auth\JwtAuthProviderReader.cs:line 148 at ExpressBase.ServiceStack.AppHost.Configure(Container container) in F:\ExpressBase\ExpressBase.Core\ExpressBase.ServiceStack\Startup.cs:line 94 at ServiceStack.ServiceStackHost.Init() in F:\ExpressBase\ExpressBase.Core\ServiceStack.Core\ServiceStack\ServiceStackHost.cs:line 200 at ServiceStack.NetCoreAppHostExtensions.UseServiceStack(IApplicationBuilder app, AppHostBase appHost) in F:\ExpressBase\ExpressBase.Core\ServiceStack.Core\ServiceStack\AppHostBase.NetCore.cs:line 224 at ExpressBase.ServiceStack.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) in F:\ExpressBase\ExpressBase.Core\ExpressBase.ServiceStack\Startup.cs:line 74} System.PlatformNotSupportedException

这是我们的Startup.cs中生成异常的行.

var jwtprovider = new MyJwtAuthProvider(AppSettings)
            {
                HashAlgorithm = "RS256",
                PrivateKeyXml = EbLiveSettings.PrivateKeyXml,
                PublicKeyXml = EbLiveSettings.PublicKeyXml, …
Run Code Online (Sandbox Code Playgroud)

servicestack .net-core asp.net-core-2.0

6
推荐指数
1
解决办法
6132
查看次数

标签 统计

.net-core ×1

asp.net-core-2.0 ×1

servicestack ×1