在Sitefinity API中为Filesystem上已存在的文档创建文件

时间:2013-07-25 20:19:18

标签: visual-studio-2012 sitefinity

我正在使用Sitefinity作为Visual Studio 2012中的解决方案。我使用的是64位计算机。我刚刚安装了Windows Identity Manager,因为我之前收到了另一个错误,并且与没有安装它有关。现在我收到了这个错误:

解码时发现无效数据。   描述:执行当前Web请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。

异常详细信息:System.IO.InvalidDataException:解码时发现无效数据。

来源错误:

在执行当前Web请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息。

堆栈追踪:

[InvalidDataException: Found invalid data while decoding.]
   System.IO.Compression.Inflater.DecodeDynamicBlockHeader() +6621162
   System.IO.Compression.Inflater.Decode() +408
   System.IO.Compression.Inflater.Inflate(Byte[] bytes, Int32 offset, Int32 length) +150
   System.IO.Compression.DeflateStream.Read(Byte[] array, Int32 offset, Int32 count) +64
   Microsoft.IdentityModel.Web.DeflateCookieTransform.Decode(Byte[] encoded) +396
   Microsoft.IdentityModel.Tokens.SessionSecurityTokenHandler.ApplyTransforms(Byte[] cookie,     Boolean outbound) +217
   Microsoft.IdentityModel.Tokens.SessionSecurityTokenHandler.ReadToken(XmlReader reader,     SecurityTokenResolver tokenResolver) +1958
   Telerik.Sitefinity.Security.Claims.SitefinitySessionTokenHandler.ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver) +44
   Microsoft.IdentityModel.Tokens.SessionSecurityTokenHandler.ReadToken(Byte[] token, SecurityTokenResolver tokenResolver) +149
   Telerik.Sitefinity.Security.Claims.SitefinitySessionAuthenticationModule.ReadToken(Byte[] sessionCookie) +520
   Telerik.Sitefinity.Security.Claims.SitefinitySessionAuthenticationModule.TryReadFromCookie(SessionSecurityToken& sessionToken) +111
   Telerik.Sitefinity.Security.Claims.SitefinitySessionAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs eventArgs) +95
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

我也在这篇文章之前和之后都遵循了这个建议,但这对我没有用: http://www.sitefinity.com/developer-network/knowledge-base/getting-type-is-not-resolved-for-member-microsoft-identitymodel-claims-claimsprincipal-exception

这导致我安装Microsoft身份管理器。我不确定如何解决这个问题。

1 个答案:

答案 0 :(得分:0)

.Net 4.5之前的Microsoft DeflateStream实施中存在错误。

See here:

  

.NET [4和以前]用户不应使用Microsoft提供的   除非在任何情况下都要使用GZipStream或DeflateStream类   微软完全用一些有效的东西替换它们。

This bug was never fixed by Microsoft用于.NET框架的早期版本而不是4.5

至于Firefox和IE之间的区别 - 在使用gzip压缩时,它们可能会与IIS进行不同的交互,如果您查看原始HTTP请求和响应,Fiddler可能会告诉您更多有关您的情况的差异。检查浏览器之间的请求序列是否相同。我的直觉是,Firefox正在回归到没有压缩,而IE则没有,但没有测试床,我将无法进一步提供帮助。


你可以按照绝望的顺序尝试这三种解决方案:

  1. 看看您是否可以在IIS中为SiteFinity应用程序更改应用程序池,将Visual Studio内的.NET框架目标更改为目标.NET 4.5,其中GZIP DeflateStream方法已修复。

  2. 为此应用程序尝试disable GZIP compression in IIS。按照此处的说明进行反向操作。我会尝试最后一次,因为您的服务器和所有用户都会受到带宽损失,从而影响用户体验。

  3. 安装DotNetZip Library,并覆盖Microsoft的System.IO.Compression.DeflateStream实现,以调用不具有相同错误的兼容方法。