Maybe it’s not their fault but then again, they built the server (IIS) and the Web tech (ASP.NET). This had me scratching my head for a few minutes until I just happened to figure it out by mistake.
I was doing an Ajax call to an aspx page with a Web Method. Something like this:
/someplace/somefile.aspx/MyWebMethod
Using JSON and JQuery. Fine. Done it a ton of times throughout the site but this time it was in a specific folder that contained files used exclusively for Ajax calls (mostly XML).
The error I was getting was:
Exception information:
Exception type: ArgumentException
Exception message: Unknown web method DoLookup.
Parameter name: methodName
Unknown web method, huh? But, the file was there, the code was in there and it worked fine on Dev…what the deuce?
After trolling the net to find something (mostly found people forgetting “static” or making their WebMethods private), the idea that the file might be corrupt popped into my head.
I thought I was stupid…after all, the aspx file just contains a basic page reference to the code behind. All the real action was in the site dll. It’d be stupid if–
Then I saw it. The file size was ZERO. Nice. I checked the delivery folder (where I drop deployments onto the server). Also zero. Great.
Checked my dev publish folder where said deployments start their life after a publish from within Visual Studio. 1kb. Oooo…looks like something died in between.
So, I copied that sucker all over again and lo and behold, the friggin thing works!
I dunno, I guess you’ve got to ask yourself what you’d do if you were trying to figure out an error message for that…how’s about Page reference missing? Or Holy Shit, your aspx file has NO CONTENT.
Ugh…Microsoft…love/hate is becoming hate/hate…