none
Object reference not set to an instance of an object while publishing web site

    Dotaz

  • hi,

    While buliding my application, it shows no error, While Publishing with Strong name key, im getting "Object reference is not set to an instance of a Object" without any line no in error list.

    what is wrong in it?

    Please guide me...

    16. srpna 2010 9:31

Odpovědi

  • At run time when you are creating the concern object it is is returning null hence the error. e.g. creating a xmldocument object while file doesn't exist at specified path

    debug your code and find out cause of exception in the code.


    Manish Sati
    • Navržen jako odpověď Roahn Luo 17. srpna 2010 2:13
    • Označen jako odpověď Roahn Luo 24. srpna 2010 1:24
    16. srpna 2010 12:01

Všechny reakce

  • At run time when you are creating the concern object it is is returning null hence the error. e.g. creating a xmldocument object while file doesn't exist at specified path

    debug your code and find out cause of exception in the code.


    Manish Sati
    • Navržen jako odpověď Roahn Luo 17. srpna 2010 2:13
    • Označen jako odpověď Roahn Luo 24. srpna 2010 1:24
    16. srpna 2010 12:01
  • Hello Akilaskk,

    Have you tried Manish Sati's suggestion?

    To add more on how to enable debugging for your web application, you could go to web.config file and make sure you set true in <compilation> section:

    <compilation debug="true">

    Lookinf forward to your reply.

    Thanks a lot!


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    17. srpna 2010 2:13
  • Akilaskk's problem: building my application, it shows no error, While Publishing ... "Object reference is not set to an instance of a Object" without any line no in error list. 

    This is not a run time problem where he is creating objects.  It is a compile / publish probem.  So the suggestion to enable debugging so he can debug his application does not make any sense.

    I have the same problem with Visual Studio 2010: clean buld, then Object reference is not set to an instance of a Object when publishing. The error has some something to do with the App_Code contents:

    Building directory '/ROCPWeb/App_Code/'.: Publication (web): Object reference not set to an instance of an object.

     

     

    My publish options were "Allow this precomplied site to be updatable" , "Use fixed naming and single page assemblies" and No strong key.

    When I removed those publish options, I got several "Circular file references are not allowed." errors.  These errors pointed to the master page reference <%@ MasterType VirtualPath="~/ROCP.master" %> on the content page.  Clearly not a circular file reference.

    Changed publish options just "Use fixed naming and single page assemblies".  Publish hangs building App_code folder (8 core, 8 gb, 2.50ghz).

    Changed publish options just "Use fixed naming and single page assemblies".  "Circular file references are not allowed." errors reappeared.

    I'm stuck.  Strangely I successfully published this web site 2 weeks ago when i uopdated it.

     

     

     

    Setting the MSBuild project build output verbosity to diagnostic did not change the build output so I could not get any more information.
    • Navržen jako odpověď SacNetGuy 27. prosince 2010 21:25
    • Upravený SacNetGuy 27. prosince 2010 21:26
    27. prosince 2010 19:47
  • Update:

    after repeatedly attempting to publish, deleting all the files in C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files (no effect), rebooting and then dusting my project with angel powder, the web site was PUBLISHED.  No clue why it successfully published. Probably tried about 20 times.

    I propose angel powder as the solution.

     


    Sac Net Guy
    • Navržen jako odpověď SacNetGuy 27. prosince 2010 21:25
    27. prosince 2010 21:25
  • Just received a request to make a change to the site so I have to publish it again but I am out of angel dust!!!! Pray for me.
    Sac Net Guy
    27. prosince 2010 22:01
  • I've been having this problem all morning and finally resolved it.

    Looks like the angel dust you need involves deleting your bin directory and starting over.  I had to re add some references but once that was complete the publish worked.  What a pain!

    31. ledna 2011 16:25
  • I hesitated posting my final "solution" because it does not make sense to me.  One of my previous attempts to solve this problem was deleting the Bin folder but that did not fix the problem.  I was encountering this Object not set to a reference intermittently.  Then another project would build but not would publish.

     

    I noticed that the folder containing all my project was compressed (for some reason).    Once I had Windows remove the compression, all my problems (at least in this area) disappeared.  If I had any guts I would compress the folder again and see if the myriad of problems re-appear.  But I wasted hours and hours already so I am not going to tempt fate.


    Sac Net Guy
    • Navržen jako odpověď SacNetGuy 31. ledna 2011 22:43
    31. ledna 2011 22:43
  • I ran into this same issue today. In an attempt to save space (SSD is smaller than conventional drives), I compressed my source folders. As soon as I did so, I started getting circular reference errors and the build wouldn't complete. It appears that Visual Stupid gets stupid when you turn on folder compression.
    28. února 2012 19:39
  • In my case that fuc... error was in my websites build for .net 4.0 that has this fuc... line:

    [assembly: System.Security.AllowPartiallyTrustedCallers]

    Remove it from your webforms and check the impact if you show reports because with .net 4.0 is there another way to configure this and works fine!!! :)
    • Navržen jako odpověď esanchezfo 17. září 2012 19:54
    15. července 2012 16:54
  • I am also getting same type of error but i am unable to find the soultion for it , i am stuck up here
    6. srpna 2012 5:35
  • I am also getting same error not able to get soultion for it .
    6. srpna 2012 5:37
  • In the worst scenario when you publish and get this error you can get the compiled (working assemblies) from C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\APPLICATIONNAME\2715857f\51b3e61d (the last two folders may vary).

    And the aspx take from original with basic changes (take a published one to adjust header only the contents are the same).

    17. září 2012 19:56
  • I can't say what occured with my website for this same problem to occur but attempted all above resolutions with no success. Found the problem seemed to be intermittent to the point where if a single page needed to be compiled it would happen.

    Same issue would build ok but not publish removing allow precompiled site to be updated solved the problem.

    Not really desirable but the only thing that would solve the issue.

    • Navržen jako odpověď Craig Downey 1. října 2012 9:49
    • Zrušeno navržení jako odpověď Craig Downey 1. října 2012 9:49
    • Navržen jako odpověď Craig Downey 1. října 2012 9:50
    • Zrušeno navržení jako odpověď Craig Downey 1. října 2012 9:50
    1. října 2012 8:04
  • Found the problem, damn Mcafee real time scanning turned it off and worked ok, turn it on and would not publish.
    1. října 2012 9:52
  • Found the problem, damn Mcafee real time scanning turned it off and worked ok, turn it on and would not publish.

    This was exactly the cause for my problem! Thanks, Craig! McAfee wasted almost two days of my time. Uninstalling it right away.

    Regards

    Z

    • Navržen jako odpověď Ogonna 6. listopadu 2012 14:47
    3. října 2012 7:16
  • Yes, for me its exactly because of Mcafee.

    I just got my software updates (include Mcafee) and then suddenly the publishing problem comes up.

    After closing real time scan and leave others, the publishing is now OK.

    Thanks Craig!

    • Navržen jako odpověď Ogonna 6. listopadu 2012 14:47
    4. října 2012 8:14
  • Found the problem, damn Mcafee real time scanning turned it off and worked ok, turn it on and would not publish.
    Same for me, this has taken 3 hours of my Life.
    • Navržen jako odpověď Ogonna 6. listopadu 2012 14:47
    6. října 2012 22:18
  • Yes macfee was the problem. Just off thr RT scanning and you will rocks
    • Navržen jako odpověď Ogonna 6. listopadu 2012 14:47
    19. října 2012 20:08
  • Macfee problem for me too !!!!!!

    4 hours spended


    -=NFT=-

    • Navržen jako odpověď Ogonna 6. listopadu 2012 14:47
    26. října 2012 0:33
  • MacAfee was the problem here too...

    Craig, thank you very much....



    Diogo Vieira da Silva

    • Navržen jako odpověď Ogonna 6. listopadu 2012 14:47
    26. října 2012 17:12
  • Found the problem, damn Mcafee real time scanning turned it off and worked ok, turn it on and would not publish.

    Same problem too for my boss and I . Thanks alot.

    McAfee should disable/rollback whatever update that's causing this.

    6. listopadu 2012 14:49
  • You are GOD Graig i spend 2 weeks to solve this issue
    26. listopadu 2012 8:53
  • Found the problem, damn Mcafee real time scanning turned it off and worked ok, turn it on and would not publish.

    Thank you very much!

    this caused me to lose a week

    30. listopadu 2012 9:00
  • I just ran into this with VS 2012, for the second time. After wasting an hour or so repairing and such, I noticed that the "Publish" button was now working even though the "Edit Publish Profiles" still produced the error message. I tried publishing to a development server using an existing profile, and it failed with a syntax error in web.config. I fixed that, published again, successfully, and then tried "Edit Publish Profiles" again. This time it worked! Something's really flaky here.

    -Megan

    16. ledna 2013 23:37
  • It has also worked for me.

    I don't know what is blocked by Mcafee real time scanning ?

    thx

    1. srpna 2013 11:21
  • I had the same issue, I just copied the code and published it using another machine having VS 2010 installed. It seems some environmental issue may be anti-virus, or any other program.
    26. září 2013 19:40
  • Just spent 9 hours replacing dll,s and debugging.

    F*c* mcafee

    23. října 2013 6:31
  • You developers are funny.  You circumvent the problem and dont solve it.  In the real world, Enterprise ePO admins wont let you turn off On-Access Scanner.
    8. května 2014 19:18
  • I actually can't believe I've actually never said this aloud on the 'Net before.

    The same care and feeding that developers have displayed in this forum regarding security concerns is precisely why the world is flooded with their easily exploitable code in the first place.

    Why don't you call your help desk, work with the security team, and arrive at a acceptable security configuration instead of tossing the baby out.  Why else do you think that security software is configurable?...

    27. května 2014 16:28
  • Hats off to you Craig!

    After spending many days researching for this issue, your solution worked. I tried everything like deleting .compiled files from bin, removing .refresh files, adding references again, upgrading VS 2012 to 2013, nothing worked and the fact of the matter is that I published this website few months ago and nothing has changed since then, no code change, site will build successfully but will not publish with option to make it update-able (publish was working fine without option of making it update-able).

    Culprit was mcafee, I turned that off and now publishing is back to normal. Thanks again.

    15. července 2014 19:59