SharePoint 2010 XsltListViewWebPart - 匿名用户拒绝访问外部xsl文件

时间:2011-08-04 07:27:23

标签: sharepoint-2010

我正在使用XSLTListViewWebPart和外部.xsl文件:

<xlslink>my.xls</xlslink>

授权访问一切正常,但如果我尝试匿名重复此操作,我会收到错误:

Error while executing web part: System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at Microsoft.SharePoint.Library.SPRequest.UpdateWebPartCache(String bstrWebUrl, Boolean bAllUsers, String bstrID, Byte[]& ppsaData, Boolean fOMCall)     
at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CacheWriteInternal(Guid storageKey, Byte[] cacheData, Storage storage, Boolean omCall)     
at Microsoft.SharePoint.WebPartPages.BaseXsltListWebPart.get_CustomizedXsl()     
at Microsoft.SharePoint.WebPartPages.BaseXsltListWebPart.LoadXslCompiledTransform(WSSXmlUrlResolver someXmlResolver)     
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXslCompiledTransform()     
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)

这是SharePoint的错误吗?

2 个答案:

答案 0 :(得分:2)

这是一个SharePoint错误。 SharePoint进行一次转换并缓存它,这是一个缓存问题。请看这篇文章了解更多详情:

http://social.technet.microsoft.com/Forums/da-DK/sharepoint2010customization/thread/3d95f279-91c0-47be-b7b9-3a0f83ff4f8c

答案 1 :(得分:0)

通过使用DataFormWebPart而不是ListViewWebPart,我能够解决这个问题。然后可以以相同的方式使用XSLT文件,似乎没有与缓存相关的问题。