Ok friends, sometimes when you are developing a web part for SharePoint and are trying to maintain Session state, you might run into the following error message ……………………………..”Object reference not set to an instance of an object.” If you are new to SharePoint or have never seen this error before you are probably wondering, now what do I do? The solution is very simple
Now, you should be good to go. eNjoy
To resolve this issue you have to follow the steps mentioned below.
Step 1:
- Open web.config for the current SharePoint Site, default location is
C:\Inetput\wwwroor\wss\VirtualDirectories\ < your sharepoint site port number >
- Find < httpModules > tag in web.config file
- Add the text between opening and closing tag shown below.
< add name = "Session" type = "System.Web.SessionState.SessionStateModule">
Step 2:
- Open IIS Manager (Click Run in start menu and then type INETMGR)
- Find the desired site in IIS Manager
- In the body panel find “Modules” and double click this.
- On the right hand panel, click “Add Managed Module...”
- In the name text box, enter the appropriate name for your session i.e. “SessionState”
- Select “System.Web.SessionState.SessionStateModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” from type dropdown.
- Click Ok.
Now, you should be good to go. eNjoy
No comments:
Post a Comment