Object reference not set to an instance of an object - Web Application Project

Last post 11-17-2009 3:32 PM by Brandon@sonerdy.com. 14 replies.

Sort Posts:

  • Object reference not set to an instance of an object - Web Application Project

    08-08-2006, 9:38 PM
    • Member
      715 point Member
    • stpeteluis
    • Member since 06-20-2002, 6:59 PM
    • Tampa
    • Posts 143

    A little background
    I installed the VS 2005 Web Application Project V1.0 Release (installation was successfull) and followed Scott Guthrie's tutorial to the letter (below)

    Tutorial 1: Building Your First Web Application Project
    http://webproject.scottgu.com/CSharp/HelloWorld/Helloworld.aspx

    However, I am getting the following error in My First Web Application Project: "Object reference not set to an instance of an object." This happens as soon as I hit the F5 key (or CTRL+F5 key).

    • I have checked all the references and they all seem to be OK.
    • I double checked myproject's properties and they match the screenshots from the tutorial.
    • I added the ASPNET and NETWORK SERVICE users with Full Permissions to the physical path for my project (D:\MyDNNProjects\ ). This didn't work either.
    • I also tried to un-install and re-install the Web Application Project V1.0 Release but the problem still persists.

    Note: The solution builds correctly and the assembly is created in the /bin directory (MyDnnProjects.dll)

    My dev environment:

    • VS 2005
    • VS 2003
    • Windows 2003 Standard
    • SQL Server 2005
    • Visual Web Developer 2005 Express Edition
    • Visual C# 2005 Express Edition
    • .Net Framework 1.1 and 2.0 SDK

    Am I missing something? Can you help?  Thanks.

  • Re: Object reference not set to an instance of an object - Web Application Project

    08-10-2006, 9:56 AM
    • Member
      715 point Member
    • stpeteluis
    • Member since 06-20-2002, 6:59 PM
    • Tampa
    • Posts 143

    UPDATE:

    I re-installed Visual Studio 2005 Team System thinking I had a corrupted install and re-installed the VS 2005 Web Application Project V1.0 Release to no avail. I am still getting the same error.

    If I open a browser and navigate to http://localhost/MyDNNProjects, the site works as expected but I loose the ability for debugging and Edit and Continue Support.

    Anybody experiencing the same behaviour?

  • Re: Object reference not set to an instance of an object - Web Application Project

    08-11-2006, 12:34 PM
    • Participant
      1,171 point Participant
    • BradleyB
    • Member since 11-06-2002, 3:53 PM
    • Posts 227

    Do you only get the "Object reference not set to an instance of an object." when running WAP? 

    I'd like you to quickly verify the behaivor of new WebSite, http://localhost/NewWebsite F5
    and new project Web Application Project, change to IIS, with http://localhost/NewWAP F5

    I would expect similar results from both commands.

    Also note, that WAP only supports "Edit and Continue" with File System Webs hosted with WebDev.WebServer.exe.  IIS WAP projects do not support "Edit and Continue"

    Let me know what you find out.

    Thanks, Brad.

  • Re: Object reference not set to an instance of an object - Web Application Project

    08-11-2006, 11:19 PM
    • Member
      715 point Member
    • stpeteluis
    • Member since 06-20-2002, 6:59 PM
    • Tampa
    • Posts 143

    Brad,

    I get the "Object reference not set to an instance of an object" ONLY when running WAP. I tried the new WebSite (http://localhost/NewWebSite) and when I press F5 I get the browser and I am able to debug without any problems.

    Now, I have a couple of new WAP projects running under IIS as opposed to File System.

    As you can see, this is really odd since (like you mentioned) both commands should have similar results.

    Thank you for your help and I really, really hope you can shed some light into this.

    - Luis

  • Re: Object reference not set to an instance of an object - Web Application Project

    08-14-2006, 9:53 AM
    • Member
      715 point Member
    • stpeteluis
    • Member since 06-20-2002, 6:59 PM
    • Tampa
    • Posts 143

    UPDATE

    I unistalled C# 2005 Express and Visual Web Developer 2005 Express, thinking one of these applications was the culprit for my issue. Then, I re-installed VS2005, the update for VS2005 to use WAP, and WAP.

    RESULT

    I am getting the same error message.

    I am really frustrated since I would expect this functionality to work as expected. Am I am the only one having this issue?

  • Re: Object reference not set to an instance of an object - Web Application Project

    08-14-2006, 1:26 PM
    • Participant
      1,171 point Participant
    • BradleyB
    • Member since 11-06-2002, 3:53 PM
    • Posts 227

    Hey Luis, send me a message at BradleyB@microsoft.com and I'll forward directions on how to create a debug dump when the error happend.  Once I get that I maybe able to help identify what is going on.

    Brad.

  • Re: Object reference not set to an instance of an object - Web Application Project

    08-17-2006, 12:09 PM
    • Member
      715 point Member
    • stpeteluis
    • Member since 06-20-2002, 6:59 PM
    • Tampa
    • Posts 143

    Brad,

    I would like to express my deepest gratitute for all your help in getting my issue resolved. You're the man !!!

    In case anybody else is having a similar issue, here's what worked for me:

    THE PROBLEM

    I was getting "Object reference not set to an instance of an object" in a Web Application Project as soon as I hit the F5 key (or CTRL + F5) to debug.

    THE CAUSE

    I think what caused my issue was the fact that I installed FireFox a few months ago and made it my default browser. I was having problems with FireFox in that I was not able to view or run some ASPX websites so I uninstalled FireFox. I then decided to install Advanced Browser (http://www.advancedbrowser.com) and made it my default browser. And again, I uninstalled Advanced Browser for other issues I was having and I think one of these two browser's messed up my Registry.

    THE SOLUTION

    The following registry key was misteriously removed from my system, therefore WAP failed.

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE

    By adding the following values so that they point to where iexplorer.exe is installed my WAP error went away:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE]
    @="C:\\Program Files\\Internet Explorer\\iexplore.exe"
    "Path"="C:\\Program Files\\Internet Explorer;"

     

    Again, Thank you for all your help !!!

  • Re: Object reference not set to an instance of an object - Web Application Project

    08-28-2007, 4:48 PM
    • Member
      2 point Member
    • ErikBo
    • Member since 05-27-2007, 12:17 AM
    • Posts 1

    Hey Brad

    As we are facing a similar problem (VS2005sp1 installed on a MOSS2007 farm): when we create a new Sharepoint-Webpart project in a brand new blank or an existing solution we are perfectly able to deploy the webpart without errors. UNTIL we switch from release to debug or vice versa. AFTER that the web-part project builds without errors or warnings - but we are no longer able to deploy due to "Object reference not set to an instance of an object" sadly enough without further information.

    (It used to work OK)

    Hope you can help

    Best regards

    Erik Bo

    BradleyB:

    Hey Luis, send me a message at BradleyB@microsoft.com and I'll forward directions on how to create a debug dump when the error happend.  Once I get that I maybe able to help identify what is going on.

    Brad.

  • Re: Object reference not set to an instance of an object - Web Application Project

    08-28-2007, 10:33 PM
    • Participant
      1,171 point Participant
    • BradleyB
    • Member since 11-06-2002, 3:53 PM
    • Posts 227

    How are you deploying to the webfarm?  Are you using VS or some other process to push the binaries?

    Thanks, Brad.

  • Re: Object reference not set to an instance of an object - Web Application Project

    08-31-2007, 5:37 AM
    • Member
      2 point Member
    • Bambu
    • Member since 08-31-2007, 9:09 AM
    • Posts 1

    hi,

     i have a similar problem but only have that error: 'Object reference not set to an instance of an object' when i want "Publish web site". The strange thing is  that days before i could publish web site and now no. Anybody has a idea?

     Thanks

  • Re: Object reference not set to an instance of an object - Web Application Project

    01-10-2008, 3:39 AM
    • Member
      2 point Member
    • bdircx
    • Member since 10-09-2007, 8:50 AM
    • Posts 1

    Bambu,

    I don't know if problem has been solved already but anyway,  I've had a same problem, the build worked fine but the publish failed returning an error: "Object reference not set to an instance of an object." without specifying a page name.  The problem was caused by a compiled cs file (I don't know how it got there) in the projects bin directory (filename I found in the bin directroy:App_Web_create_new.aspx.cdcab7d2.dll).  So I recommand checking on a simular problem in your visual studio project.  After removal of this file the publish worked fine again.

     regards

    Filed under: ,
  • Re: Object reference not set to an instance of an object - Web Application Project

    09-25-2008, 12:37 PM
    • Member
      4 point Member
    • jcraigue
    • Member since 09-25-2008, 4:36 PM
    • Posts 2

    I'm getting this as well - if I clean out my temp folders, the error disappears.

    I need to try and pin down exactly what the files are that are causing the problem, but I'm willing to bet they are temporary compiled files from the web project.

  • Re: Object reference not set to an instance of an object - Web Application Project

    01-29-2009, 7:37 PM
    • Member
      2 point Member
    • nl_vinodh
    • Member since 08-11-2008, 9:38 PM
    • Posts 2
    Hi,

    I am also facing the same problem.  I am working on web application in VS2005. When I am building / compiling my presentation project I am getting "object reference not set to an instance of an object". I am keeping getting on this error for ever compile (mode then 20 times).   When looked into Output build, noticed this.

    Building directory '/PL/UI/PlantManagement/ServingOffices/'./: Build (web): Object reference not set to an instance of an object.

    Can you help me to fix this issue?

    Vinodh

     

  • Re: Object reference not set to an instance of an object - Web Application Project

    02-06-2009, 1:06 AM
    • Member
      2 point Member
    • ASeign
    • Member since 02-06-2009, 5:55 AM
    • Posts 1
    Please check the files in the /bin directory, it mostly because of the *.compiled files incorrectly copied into the /bin directory. Just delete them. also you can see the call stacks of this error by using "aspnet_compiler.exe" and the "-errorstack" switch.
    nl_vinodh:
    Hi,

    I am also facing the same problem.  I am working on web application in VS2005. When I am building / compiling my presentation project I am getting "object reference not set to an instance of an object". I am keeping getting on this error for ever compile (mode then 20 times).   When looked into Output build, noticed this.

    Building directory '/PL/UI/PlantManagement/ServingOffices/'./: Build (web): Object reference not set to an instance of an object.

    Can you help me to fix this issue?

    Vinodh

     

  • Re: Object reference not set to an instance of an object - Web Application Project

    11-17-2009, 3:32 PM

    Good call on the *.compiled files in the bin directory. 

Page 1 of 1 (15 items)