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

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


I also had this problem and it was not solved by any of the ideas mentioned previously. The problem was that somehow compresssion had been enabled on the subfolder of my drive containing the ASP.NET website. The solution is to right-click, choose properties and in the general tab, click Advanced and under the 'Compress or Encrypt attributes' section, make sure 'Compress contents to save disk space' is unchecked. Upon prompting do this for all files and subfolders (note it may take some time). Hope this helps someone.


OK.After wasting so many hours I somehow got to this blog:http://thesoftwarepractice.net/development-things/object-reference-not-set-to-an-instance-of-an-object

Turned off the McAfee Real Time Scanning and its works...


This is a hard to catch issues, which usually comes with webforms aspx pages.

If you are deploying the app with pre-compiled option and you have selected the "Do not merge, create a separate assembly for each page and control" here:

enter image description here

then you need to make sure that there are no compiled assemblies for any of the aspx pages in the bin folder of the project you are trying to compile. Go to your bin folder and delete any assemblies related to your web pages and try publishing again. This will fix this issue.