publishing asp.net website give “Object reference not set to an instance of an object.” error

后端 未结 10 1524
遥遥无期
遥遥无期 2021-02-15 05:24

I am getting fed up with this error. I have search all over the web and tried every possible suggestion to this error I could find.

  1. delete app_code, build, add fil
相关标签:
10条回答
  • 2021-02-15 05:37

    Deleting all the *.compiled files from Bin folder of the website works for me. :)

    These files are safe to delete and are created during precompilation. For more info check this MSDN link.

    0 讨论(0)
  • 2021-02-15 05:41

    I have recently encountered this Error. As @samiz mentioned above, First of all, you need to delete all *.dll.Refresh after that build and publish your website. However, sometimes, as happen for me, when you have deleted *.dll.refresh, then publish your website, Error reminds as usual. I have done a lot of tests, but nothing changes.

    I also create a new folder and copy all *.dlls which I need for my website. Next, delete all *.dll inside Bin folder then add them by one.

    Finally, I re-start My PC, and then I try to publish my website. Believe me or not, it works fine and no error occurred.

    0 讨论(0)
  • 2021-02-15 05:43

    In my case, clearing cookies resolved the issue.

    The StackTrace had mentioned some authorization and cookies thing. I opened the web application in InCognito mode (which do not persist cookie store) and found the app working.

    Hope it helps somebody.

    0 讨论(0)
  • 2021-02-15 05:44

    I had a similar issue. The application would build and run in the IDE, but fail to publish; conking out at the 'merge dll into single assembly' stage. After researching aspnet_merge.exe I found that the issue was resolved by unchecking the 'emit debug information' checkbox in the publish options.

    It may not be a 'clean' fix for the issue, but it's a workaround.

    Hope this helps.

    Andrew

    0 讨论(0)
  • 2021-02-15 05:45

    I had the same experience and removing the compressed flag from the solution directory tree, set the compiler working again.

    0 讨论(0)
  • 2021-02-15 05:47

    I know this is an old post, but just in case someone will find this usefull:

    The cause of this problem for me was the McAfee anti-virus

    ASPNETCOMPILER(0,0): Error ASPRUNTIME: Object reference not set to an instance of an object

    0 讨论(0)
提交回复
热议问题