Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

徵兆

當您使用沙盒解決方案或網頁組件時,可能會在 SharePoint 整合記錄系統 (ULS) 記錄檔中收到類似下列內容的錯誤訊息。 這些訊息指出某些沙盒解決方案或網頁組件遭到封鎖。

對於已安裝 2022 年 5 月安全性更新的 SharePoint Foundation 2013 與 SharePoint Enterprise Server 2016:

事件識別碼

訊息

ajrme

ExecuteRequestInSandBox 呼叫失敗。 System.ArgumentException: 類型無法解析,在 Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.SPUserCodeSerializationBinder.BindToType(String assemblyName, String typeName)
在  
…...  

ajlz0

收到例外狀況 System.ArgumentException 的錯誤訊息: 類型無法解析,在 Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.SPUserCodeSerializationBinder.BindToType(String assemblyName, String typeName)
在 
…...

對於已安裝 2022 年 6 月或之後安全性更新的 SharePoint Foundation 2013,以及已安裝 2022 年 7 月或之後安全性更新的 SharePoint Enterprise Server 2016:

事件識別碼

訊息

6k389

無效類型: 類型=XXXXX; 組件 = YYYYY,於 SPUserCodeSerializationBinder。 請造訪 https://go.microsoft.com/fwlink/?LinkId=2196531 以取得詳細資訊,以及了解如何解決此錯誤。

ajrme

ExecuteRequestInSandBox 呼叫失敗。 System.ArgumentException: 類型無法解析,在 Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.SPUserCodeSerializationBinder.BindToType(String assemblyName, String typeName)
在  
…...

ajlz0

收到例外狀況 System.ArgumentException 的錯誤訊息: 類型無法解析,在 Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.SPUserCodeSerializationBinder.BindToType(String assemblyName, String typeName)
在 
…...

原因

從 2022 年 5 月的安全性更新開始,SharePoint 沙盒服務進一步限制預設允許執行的類型和組件。 

解決方案 

若要解決此問題,您必須登錄 SharePoint 沙盒服務允許執行的協力廠商類型或組件。 如果要執行這項操作,請依照下列步驟執行:

  1. 對於 SharePoint Foundation 2013,請安裝 2022 年 6 月或之後的安全性更新。 對於 SharePoint EnterpriseServer 2016,請安裝 2022 年 7 月或之後的安全性更新。 

  2. 使用受影響的沙盒解決方案或網頁組件來觸發問題。 

  3. 開啟 SharePoint ULS 記錄檔並尋找事件識別碼 “6K389”。 您將會找到具有該事件識別碼的下列訊息: 

    無效類型: 類型=XXXXX; 組件=YYYYY 於 SPUserCodeSerializationBinder。 請造訪 https://go.microsoft.com/fwlink/?LinkId=2196531 以取得詳細資訊,以及了解如何解決此錯誤。

  4. 記下遭到封鎖的類型和組件。 

  5. 開啟沙盒解決方案或網頁組件所在 Web 應用程式的 web.config 檔案。 web.config 路徑一般看起來類似下面:

    C:\inetpub\wwwroot\wss\VirtualDirectories\<web 應用程式連接埠>

  6. 在 configuration/SharePoint/SafeMode 區段中,加上 AllowedListItems 元素。  

  7. AllowedListItems 元素內,新增一個 AllowedItem 元素,並依照下列格式,將 Name 屬性設定為 AllowedSandboxType

  • 若要解除鎖定特定類型,請依照下列格式新增具有 Type 屬性的元素:

    <AllowedItem Name="AllowedSandboxType" Type="XXXXX"/>

  • 若要解除鎖定特定組件,請依照下列格式新增具有 Assembly 屬性的元素:

    <AllowedItem Name="AllowedSandboxType" Assembly="YYYYY"/>

範例如下:

<SafeMode  

            MaxControls = "200"   

            CallStack = "false" 

            DirectFileDependencies ="10" 

            TotalFileDependencies = "250" 

            AllowPageLevelTrace = "false" 

            ControlCompatMode="false" 

            > 

            <PageParserPaths> 

            </PageParserPaths> 

         <AllowedListItems> 

     <AllowedItem Name="AllowedSandboxType" Type="Microsoft.SharePoint.Portal.WebControls.RSSAggregatorWebPart, Microsoft.SharePoint.Portal, Version=15.0.0.0, Culture=neutral, PublicKeyToken=xxxxxx"/> 

             <AllowedItem Name="AllowedSandboxType" Assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxxxxx"/> 

         </AllowedListItems> 

</SafeMode> 

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×