Geeks With Blogs

My Techie Blog Knowledge Creation is Essential to Business, and Communication is Essential to Knowledge Creation
When you download and install  the Visual Studio 2005 Extensions for WSS3.0.
You could have taught wow my deployment stress is over
But actually it isn't  its just the start

I had deployed several webparts to my sharepoint sites without getting the error 

Object reference not set to an instance

But after sometime these ugly errors started popping up .

One was
Object reference not set to an instance the other was some GUID error


After pulling out my hair i didn't have i found an individual who shed a light on it here at   WSSWIKI

He even add a missing feature application you can download.But when i tried running the application
i get error it can't access the database

Later i found this solution below :-

PROBLEM:

========

Deploying webpart to SharePoint 2007 using  Visual Studio Extensions for Windows SharePoint Services (VSE WSS) and getting error message “Object reference not set to an instance of an object”.

 

RESOLUTION:

===========

1] Copy the built webpart.dll to c:\windows\assembly (GAC)

 

2]  In the folder location where webpart VSE solution was created found setup.bat file in bin\Debug, and this is the file which VSE calls when deploying the solution and has instructions to run it. Ran the setup.bat from command prompt as “setup /uninstall” this ran ok, then ran setup /install this ran ok too. Modified the setup.bat file and add the line to remove the webpart.dll from the GAC and add the webpart.dll assembly to GAC as under:

 

under :LDeploy section before goto :EOF added the following line:

===========================================================

"%programfiles%\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" -if webpartTest.dll

"%programfiles%\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" -uf webpartTest

iisreset

**Make sure you changed the name of your webpart to the one in question

This solved my problem but sometimes it did work sometimes it didn't and  the solution need a lost of manual process.

Al last i came across this featurecleaner Utility
And it did the TRICK it actually fixes it and deletes orphaned features from the feature table.

Hope the next VseWSS ver 1.2 will be out soon

Enjoy

Posted on Tuesday, April 22, 2008 9:00 PM Sharepoint(WSSv3) | Back to top


Comments on this post: Object reference not set to an instance - Webpart Sharepoint

# re: Object reference not set to an instance - Webpart Sharepoint
Requesting Gravatar...
Thanks mate! This helps a lot!
Left by Stark Botha on May 28, 2008 10:08 AM

# re: Object reference not set to an instance - Webpart Sharepoint
Requesting Gravatar...
Thanks a lot for your post! It was very helpful!

I've had the same problem on deploying any solution into sharepoint (webparts, custom fields, etc).

I just want to share what I did to get it working:

- I retracted and undeployed the solution I was working on;
- then, I ran the Featurecleaner Utility finding 2 orphan features. I erased them.
- Finally, I deployed the solution successfully.

I hope this is useful for someone as the first post was for me.


Thank you.
Left by Thiago Bortot R. Chagas on Aug 08, 2008 9:24 AM

# re: Object reference not set to an instance - Webpart Sharepoint
Requesting Gravatar...
Server Error in '/WebApplication2' Application.
--------------------------------------------------------------------------------

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 36: Dim picinfo As FileInfo
Line 37: Dim picpath As String
Line 38: Dim pichttp As HttpPostedFile = Request.Files("file1")
Line 39: If (pichttp.FileName).ToString <> "" Then
Line 40: picinfo = New FileInfo(pichttp.FileName)


Source File: C:\Inetpub\wwwroot\WebApplication2\WebForm1.aspx.vb Line: 38

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
WebApplication2.WebForm1.Button1_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\WebApplication2\WebForm1.aspx.vb:38
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Left by hamid on Aug 10, 2008 11:46 PM

# re: Object reference not set to an instance - Webpart Sharepoint
Requesting Gravatar...
Thanks a lot ,
I have got use to the fact that when microsoft makes a solution for a problem it makes an other problem, any way

Keep up the good work
Left by web development company on Aug 17, 2009 11:25 AM

# re: Object reference not set to an instance - Webpart Sharepoint
Requesting Gravatar...
i m getting the same error , and yet not find any solution...
Left by girish kolte on Apr 17, 2010 7:43 AM

# re: Object reference not set to an instance - Webpart Sharepoint
Requesting Gravatar...
Excelente, gracias me haz salvado la vida, jajajaja
Left by Rodolfo on May 06, 2010 12:27 PM

# re: Object reference not set to an instance - Webpart Sharepoint
Requesting Gravatar...
Hi

I had the same error message. I generated a solution with SPSolGen.exe V1.3 and modified the ONET.xml:

<Modules>
<!--
<Module Name="Home" />
-->
</Modules>

With the "Package" command i got the error message "Object reference not set to an instance".
I removed the commented lines:

<Modules>
</Modules>

Now i could package the Solution without problems. It looks that comments in xml files are not possible.

Greetings,
Roli
Left by Roli on May 13, 2010 7:25 AM

# re: Object reference not set to an instance - Webpart Sharepoint
Requesting Gravatar...
error : Object reference not set to an instance of an object.sorry idid not get it
please explain step by step
Left by ramesh on Jul 01, 2010 3:55 AM

Your comment:
 (will show your gravatar)


Copyright © Patrick.O. Ige | Powered by: GeeksWithBlogs.net | Join free