SharePoint - An unexpected error has occurred

2019-02-19 04:17发布

In SharePoint I am getting the following when I go to my new web part page:

Error

An unexpected error has occurred.

Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator. Troubleshoot issues with Windows SharePoint Services.

I have tried the following to get a more useful error message:

In web.config I have:

<SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="true">

and

<customErrors mode=“Off“/>

I have added the following to my web.config in my layout folder

<SharePoint>
    <SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false" />
</SharePoint>

What else can I do see a stack trace?

5条回答
贼婆χ
2楼-- · 2019-02-19 04:29

Try setting

<compilation debug="true" />

in web.config

查看更多
迷人小祖宗
3楼-- · 2019-02-19 04:38

Have you checked the SharePoint Log files?

查看更多
贼婆χ
4楼-- · 2019-02-19 04:47

If you would like to know what exact error description is, then you need to make following changes in your SharePoint web application web.config file.

  1. CallStack="false" changed to CallStack="true"

  2. <customErrors mode="On" /> changed to <customErrors mode="Off" />

Save it and do IISRESET from command line.

Open Page again then you will get exact error.

查看更多
ゆ 、 Hurt°
5楼-- · 2019-02-19 04:49

it might be that the .dll that has the compiled webpart code is not copied to bin/GAC directory. next thing I would do is to check whether the web part is in site/site collection web part gallery

hth

查看更多
Anthone
6楼-- · 2019-02-19 04:56

You can try to wrap your WebPart code with the Try Catch Block. Looks like some exception is left uncaught.

查看更多
登录 后发表回答