ServiceStack NuGet update 4.0.22 to 4.0.31 caused errors on deployment

╄→гoц情女王★ 提交于 2019-12-20 03:52:50

问题


I'm hoping not to be to vague here, but I've just done a NuGet update for ServiceStack, updating from version 4.0.22 to 4.0.31, the project compiles fine but once deployed to iis I'm getting this error when I hit the site.

Method 'get_Cookies' in type 'ServiceStack.Host.AspNet.AspNetRequest' from assembly 'ServiceStack, Version=4.0.31.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

Wondering if anyone else is having this error?


回答1:


A side-effect of ServiceStack converting ServiceStack.Interfaces.dll into a pure PCL dll in v4.0.30 is that projects that reference interfaces with System.Net classes now require an explicit reference to System.Net.

Install Patch for PCL Support with .NET 4.0

From similar .NET 4.0 Issue with Google OAuth PCL libraries:

  1. Make sure your .NET framework is patched. Microsoft released patches to .NET 4.0 to allow Portable Class Libraries to properly find the appropriate runtime (info KB2468871). If you are seeing the above exception (or something like it), it means you're missing the latest .NET framework patches.

  2. Install .NET 4.0 full profile




回答2:


I had the same problem, and I believe I've traced it back to not having KB2468871 installed on some client machines. This causes weird errors such as the one you are seeing. My particular one was this:

Method 'GetAsync' in type 'ServiceStack.JsonServiceClient' from assembly 'ServiceStack.Client, Version=4.0.30.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

I tried adding the System.Net reference and that didn't clear it up either.

For now, I'm sticking with 4.0.24 (the pre-PCL version) until I can come up with a better solution, since I'm not in control of the client environment. Note that if you are using ClickOnce, you can add this particular update as a prerequisite to the bootstrap installer, but it won't have an effect on already-installed machines, thus the problem here.



来源:https://stackoverflow.com/questions/25859049/servicestack-nuget-update-4-0-22-to-4-0-31-caused-errors-on-deployment

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!