All About SharePoint

Liedong(Ken) Zheng,SharePoint Leader at SIMPLOT

Archive for September 29th, 2008

Easily get to the WebPart Maintenance page for any Sharepoint Site Url

Posted by ken zheng on September 29, 2008

Symptom:

Often times, developers in WSS3.0/MOSS2007 probably run across the issue where a web part is dropped on to a page
and then Sharepoint errors out for one reason or the other. Sometimes, the user is directed to a Web Part Maintenance page,
which helps the developer remove the offending web part from the page.

However, there is no way to get to this page from any easily available link.

Resolution:

In order to get to the Web Part Maintenance page for ANY sharepoint url, try the following trick.

Append the querystring ?contents=1 to the url in the browser as shown below

http://portal/area/default.aspx?contents=1

Posted in Sharepoint | Tagged: , , | 2 Comments »

Packaging a WCF Service as a SharePoint Solution

Posted by ken zheng on September 29, 2008

A great post show you how to Packaging a WCF Service as a SharePoint Solution
http://www.intranoggin.com/Lists/Posts/Post.aspx?ID=23

Posted in Uncategorized | Tagged: | Leave a Comment »

Create a SharePoint WebPart calling Web Service

Posted by ken zheng on September 29, 2008

To call a WCF Web Service, your code needs to have a config file. To do this in Sharepoint 2007, you need to use the web application config file so you can edit the web.config file of that web application adding the bindings and the client sections to the system.serviceModel section making the web.config file will look something like that. Add ServiceModel seciton after configSections

WebPart Config

The way I did is to create a WCF in VS 2008. Hosted and create a webpart in vs 2008. Use the same way to add service reference and write some code. Remember always catch excpetion in webpart otherwise the whole page will not work. Deploy the web part and modify the web.config to add ServiceModel.

Posted in Sharepoint, VS2008 | Tagged: , | 2 Comments »

General guideline for troubleshooting SharePoint issues

Posted by ken zheng on September 29, 2008

This is the list of steps to follow for troubleshooting general SharePoint issues.

1. Turn on the debug flag from SharePoint web.config

Note: Enabling debugging is not recommended on a production environment.

a. Locate the SharePoint web.config file which is typically located under one of the virtual directories in C:\Inetpub\wwwroot\wss\VirtualDirectories.
b. Make a backup of the web.config just in case.
c. Open the SharePoint web.config using a Visual Studio or a text editor such as notepad.
d. Find “CallStack”
e. Change the value of CallStack to “true”
f. Find “CustomErrors”
g. Change the value of CustomErrors mode to ”off”
h. Save the web.config.

2. Reproduce an issue you’re having i.e. by refreshing the broken web page

3. Examine the error from EventLog. In most cases, you will find no useful information from EventLog since SharePoint does a poor job leaving a trace on the EventLog.

4. Go to SharePoint logs folder (c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\Logs). SharePoint dumps all logs in this folder, and so you should be able to find clues by examining logs in this folder.

a. Sort items by Date Modified
b. Open the latest log file using a notepad or other text editors.
c. Scroll down to the bottom
d. Examine the latest log

5. Analyze error messages found from Step 2, 3 and 4.

6. Investigate issue for 10 minutes

a. Examine the system account used for an application pool of a SharePoint application. Does the account have proper permissions?

7. If you’re stuck for more than 10 minutes, stop what you’re doing.

8. Search for the clues from Internet — Many times, we forget how useful Internet is and that somebody else typically had the same problem before.

9. If no clues have been found, ask for help.

a. Describe detailed steps how to reproduce the issues
b. Ask colleagues or reach out communities such as the MSDN SharePoint Forums [1]

10. Iterate the step 1 to step 5 until an issue is resolved.

[1] – http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=328&SiteID=1

Posted in Sharepoint | Tagged: | 2 Comments »

SharePoint dev tip – easily go to the 12 Hive

Posted by ken zheng on September 29, 2008

Just wanted to share a tip I find really useful. The idea being, I find myself going to the 12 hive quite often via command prompt.

Just create a file called 12.cmd and put it in your C:\Windows directory in the file put:
c:
cd c:\program files\…12… then from anywhere, just type 12 and voila!

Posted in Handy Tips, Sharepoint | Tagged: | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 28 other followers