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.
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.
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.
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.
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
I had the same experience and removing the compressed flag from the solution directory tree, set the compiler working again.
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