Object reference not set to an instance of an object error.

i've installed the VSeWSS.msi on VS 2005, i'm using SPS 2007, i'm developing on my workstation in C#, i've added the Mircosoft.Sharepointserver dll reference to my project but i still can't deploy a very basic webpart. i get the "Object reference not set to an instance of an object" error but there's no reference to a line, column, project or anyhting. very frustrating. any suggestions/links whould be appreciated.
[434 byte] By [inbanco] at [2007-12-29]
# 1

When developing with VSeWSS.msi you need to work directly on the server.

There are several build events that call STSADM.exe to deploy solutions etc.

Being locally on the server also makes step-by-step debugging easy (bind worker process)

Also (unfortunately) this is the recommended setup from MS.

hth

AndersR

AndersR at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Development and Programming...
# 2

Same problem here

I used to be able to compile without problem and sudenly I get this same error

MaxBrassart at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Development and Programming...
# 3
Im having the same problem. Is the only solution to also install the whole SPS 2007 environment on your workstation or is there an other solution?
RikS at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Development and Programming...
# 4
You could set up a dev environment in VPC 2007. It's a free download and it'll probably save you heaps of configuration time in the long run.
NickCox at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Development and Programming...
# 5
I am getting the exact same thing and I am running everything on the same server. It's very frustrating as I had a version of the application working but all of a sudden I am unable to deploy it or test it and my client, understandably, is starting to get angry.
JonLind at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Development and Programming...
# 6
I have the same problem. I can build and deploy a solution once from the VSeWSS templates. After that i get the error. I've noticed it's not building the wsp file necessary for solution deployment (if you go look at the datestamp on the .wsp file, you'll see it's not changing on each failed deployment).

This behavior just started one day out of nowhere, and it drives me nuts. It's too bad because that made life a lot easier for debugging web parts.

What i've done to keep things a little automated is to create a few external tools that run stsadm.exe with the appropriate arguments to add, upgrade, retract etc., which i can run from within VS2005 at least. Before doing that though, you still need to build your wsp file using makecab.exe, so it's still not a very automated process and is a big pain to debug.

perhaps this problem will get fixed. Thus far my complaints about it have been met with "you really shouldn't be using VSeWSS."

pignion at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Development and Programming...
# 7
Same problem here.
jherschel at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Development and Programming...
# 8
same here
behzad at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Development and Programming...
# 9
i found something that works for me... i ignored the error and built the project anyway, copied the dll from the debug dir to the bin in sps, strong named it and allowed partially trusted calls and bingo, my sps website allowed me to import my very basic webpart.

now all i need to do is work out how to do the above in vb.net (my preferred lang) and i'll be mildly happy

inbanco at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Development and Programming...
# 10
I removed From the top of my web part and it worked!!!!

XmlRoot(Namespace = "namespace")

behzad at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Development and Programming...
# 11
I have same error. But in 1st time i can add my webpart to the page. But then, when i make some changes on my web part, i can't see them on page.
And ALL time i get this error "Object reference not set to an instance of an object error. Line 0 Column 0"

Please help..

sourvil at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Development and Programming...
# 12
I have the same exact problem, anyone have the solution ?
RoozNet at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Development and Programming...
# 13

Hello everyone. There are few threads around about this issue. I put in a case with Microsoft Support a few weeks ago and here is the conclusion I received. Good luck getting ahold of a support person now. Waiting times are 40 business hours (yes, that's two weeks).

Hi George,

It was my pleasure to serve you during your “err when deploying webpart thru VSE "Object reference not set to an instance of an object” issue. I hope that you were delighted with the service provided to you. If you ever have any questions please feel free to call me. My contact information is below.

Since we have addressed the issue this case was created for, and have received confirmation from you, I have closed the case with ID# SRX070424XXXXX

I am providing you with a summary of the key points of the case for your records.

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

Thanks for your time and patience in this matter.

Thank You,

GeorgeOlson at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Development and Programming...
# 14

Thanks George for saving me 40 hours of waiting time and my hair as I don't have to pull any more out.

Jon Herschel

jherschel at 2007-9-5 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Development and Programming...

SharePoint Products and Technologies

Site Classified