4/22/12

SharePoint Use Correlation Id to Get Error Detail

When activating a SharePoint feature or creating a sub-site from a custom web template, you have probably received a few errors from SharePoint which show a correlation id and nothing additional that can indicate what the problem is. The purpose of this id is to allow you to find additional information about the errors by reading the ULS trace log (Unified Logging System). You can find the details of the error by using PowerShell. To use this, first open the SharePoint Management Shell. You can then type this command in the shell:

Get-SPLogEvent | Where{$_.Correlation -eq "GUID"} | Format-Table Category, Message  -wrap -autosize | Out-File -filepath c:\log.txt

Replace the word GUID by the correlation id that you see in the error message. This command basically reads the log information associated to the id. It formats the message in a table by reading the category and message columns. You should also notice that we want to read the entire message with no truncation, so we need to use the -wrap switch. The out-file parameter sends the output to a file on the C: drive.

The output should provide detail information on what the actual error is. This can allow you to correct the problem.

I hope this helps.

og-bit.com

SharePoint Exception 0x8107026E When Activating Module

When you encountered the 0x8107026e exception during the activation of the error, you should read the stack trace information to see if the error is related to the ONet.xml file. There would probably be a LocalizedXml function call which returned the error. This however does not provide the root of the problem. To find out what is going on, you need to open the SharePoint log files. These files can be found in a path similar to this:


%Program Files%\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS 

or if your system has the environment variable set properly, you can use this:

%SHAREPOINT ROOT%\\LOGS

Open the current file using notepad, so you can find more detail information on what is going on. This error is usually associated to the fact that the ONet.xml file is deployed to a different folder or just was not deployed. So if you look at the log, you can probably find this error:

Failed to open the file 'Features

and

The specified path "" does not exist

To resolve this problem, look into your project definition. First select the Web template folder and read the folder name under it. This is the expected folder name where the files should be deployed. Now make sure that this matches the name of the actual web template. Expand the folder and select the Element.xml file. Look for the Name property and make sure that this matches the folder name.

If the folder and template name are matching, you can now look to see how the ONet.xml file is being deployed. Select the ONet.xml file and look at its properties. The following properties should read as follows:

Build Action: Content
Deployment Type: ElementFile

Also look at the deployment location. This should match the folder name.Make the necessary changes and re-package your solution. This should address the error.

I hope this helps.
og-bit.com