Getting "Debug Info" for a Sharepoint error!

来源:互联网 发布:sql object id 编辑:程序博客网 时间:2024/06/06 12:51

Some time ago I had the brightidea of moving the SQL databases for Sharepoint. I was running a VPCwith only one virtual drive and started running out of disk space. So Idecided to create another virtual drive, detach the SQL databases fromSQL Server, copy them to the new drive, mount the databases and testthe Sharepoint configuration.

Everything should have workedperfectly, wrong! In theory Sharepoint should only be looking at thelogical names of the databases, but it seems that I was mistaken. Mostof the functionality in Sharepoint worked perfectly expect for"MySite". When I selected the link at the top of the Sharepoint site.

MySite Link

I got the following error.

File Not Found

As you can see it is completely descriptive and tells you exactly what to do to fix the error, NOT!!!!

So,now what! Without some more information to go on, it becomes a bitdifficult to resolve the error and as we all know the "Event Log" onlygoes so far.

Fortunately Sharepoint has been built using the.NET framework and we can use that to get some more info. To do this,we need to go and change some settings in the web.config file that sitsin the root of the web site in IIS. Even tough Sharepoint stores mostof its information in the SQL Server content database, it still needsthe .NET framework to process this information.

To find the web config file, we need to navigate to the "Inetpub" directory using windows explorer.

Folder Structure

Underthe "Inetpub -> wwwroot -> wss -> Virtualdirectories" folder,you will find sub folders representing each of the web applicationsused by Sharepoint including the system web applications. Each of thesehave their own web.config file.

Edit Web Config

Findthe correct folder representing the web application causing the problemand edit the web.config file using your preferred text editor. I likeusing "Notepad" as it is "Light Weight" and does not have all the"Bells" and Whistles" I do not need.

There are two section thatwe need to modify in this file. The first section involves the "CallStack" of the .NET framework. This will give us a list of all theassemblies involved in the error. This can be done by setting the"CallStack=True" flag.

Callstack True

Thesecond thing that we need to do is switch the "customErrors mode=Off"so that the information will actually be displayed on the screen.

Custom Error Off

Oncethese options have been configured and the web.config file saved. Wecan then re-simulate the error and see what you get back.

Complete Error

Asyou can see, we now get a lot more information back that canpotentially be used to help resolve the error. I did not say theinformation will be useful, I only said that you will have more of it.

Rememberto change the web.config back to it's original state after you haveresolved the error. This information should not be available publiclyon the intra or Internet as this could be a potential security risk.

Related Blogs:

ASP.NET error registering with IIS

Overview of the .NET Platform

.NET 2.0 Framework

原创粉丝点击