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…
So, Windows 7 is RTM now. And presales are running rampant. I hate to say it but I haven’t had a chance to preview it (yes, I downloaded an RC or two but I hadn’t had the time to setup a VM to test it on). Maybe now’s a good time to do so!
Vista was a complete mess. There was no reason to upgrade to it unless you were an uber hard-core gamer (like a friend of mine) and really really wanted DirectX 10 support. Well, after watching said friend run into wall after wall (mostly driver incompatibility walls), I sat back with my XP install and continued to enjoy everything Windows XP had to offer…like a stable platform to be productive on.
Will Windows 7 be the anti-Vista and actually bring more people like me back into the Microsoft OS upgrade loop again? Maybe. The biggest single hurdle for me (beyond having to deal with the annoyance of reinstalling everything again) is whether or not all my XP apps and games will install and run just as smoothly (if not smoother) on Windows 7 as they did on XP.
I guess we’ll know in a couple weeks…though, despite not knowing, I do have an outstanding pre-order with Amazon.
kn
So, I’d just merged some code into my test build to prepare a deployment to staging when I got a compilation error on a page stating that a “}” was expected and referencing a line in a temp file from the GAC that included a line like this:
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
I’m scratching my head…wtf? I searched for the above and found a reference in the strings resource I had for the site. But, there weren’t any problems with the code…in fact, the site compiled just fine! More scratching…then I searched online. Found this. Different error but the same or rather a similar stack trace.
Then I thought about it. Missing closing bracket…well, we’d just modified some code recently that involved what I’m sure Microsoft would rather we didn’t do…in the front-end aspx file we did something like this:
<% if (something == true) { %>
<myfancyhtml></myfancyhtml>
<% }//end if %>
And, lo and behold, the recent merge managed to include two copies of the opening line with a single closing line. Lovely.
Anyhow, in case you run into this wonderfully obscure error, check your <% %> tags if the code behinds still compile successfully…probably have something in there that’s causing you problems…no need to reboot and all that crap.
kn
I’m a convert. I used to be a die-hard IE user. I even stuck to my guns for a long time before switching from IE6 to IE7 (I’m not using tabbed browsing if FireFox invented it). But, as I moved to a new company and started working on a consumer-oriented site (the majority of which still use IE) but with html and Ajax (don’t get me started on Microsoft’s server-side Web strategy, 3.5 and Ajax.net be damned) I really wasn’t interested in using Microsoft for anything. Of course, it’s what I know so I ended up grudgingly building the site in .Net (originally sticking with 2.0 but upping it to 3.5 to support some .Net controls).
So, I’m doing my best here to balance the best of both worlds. I’m using master pages (they are pretty sweet) but not using server-side controls (except for Telerik) if I can help it.
In order to get from point A to B without having to invent it all again, I decided to use the jQuery JS library. It’s a great library and gets better with age. When you use a single line of code to update an entire layout or use it for XML (as some stalwarts like to point out, it’s not an XML parser but dammit, it’s an HTML parser so guess what? They’re related.), you’ll be sold.
I upgraded recently, or rather, started an upgrade, to a new version, 1.3 so I could get some speed benefits but also so I could use v1.6rc5 of the UI plugin. That sucker’s got some beautiful controls (and they’re not server-side!!). Thing is, after happy tapping out a dialog form and testing it out (successfully) in FireFox 3, that little storm cloud on my shoulder that warns me of coming dangers whispered, “Try it in IE…” I said, naw, but then it struck me with lightning so I tried it.
“Invalid argument. Line 23,102,203 of your huge codebase.” Another informational Microsoft alert.
I put it through the debugger which wasn’t much help. Oh, I found the code where the error was but it was a normal bit of code that worked for everything else. After much banging against many walls, I finally decide to post to the Google groups for the UI development. I hate posting there because Google seems to offer up a way for people to get your e-mail address (really? Do ya have to?) that, despite a reCaptcha gate still resulted in me getting tons of spam on a gmail account I NEVER use for anything else. I’m so glad my paranoia told me to use that address rather than my main account.
Anyhow, as I’m going through this long drawn out affair of describing the issue and throwing blocks of HTML, CSS, and JS up there I just happen to write, “I’m using the XHTML 1.1 dtd on this site.” Gotta love me being thorough. I say, what if I switch it to 1.0 transitional?
I do and BAM, it works just fine. In fact, the original issue that made this come up (the dialog was all of 20 pixels high despite a declaration of 500px high in the JS) was also gone.
Then I remembered. IE7 may be MORE modern than IE6 (can you believe 25% of people out there browsing now still use that old piece of crap that shipped with Windows Me and 2000?) but it’s definitely not up with the standards. FF3 is. And, IE8 is supposed to be (downloaded that sucker but I want to set up a VM slice to try it out…) but that’s still a little ways off (I used to install beta software left and right and still do but with MIcrosoft, I’ve taken a new approach: I wait for at least 3 months if not 6 months and if that SP you know is going to come out is announced, I might even wait for that). Microsoft’s beta testing program (read: product launches) has gotten out of hand.
So, though I must support IE7 (and the fact that they released that sucker with Vista means it’s not going anywhere until Vista’s lifecycle is done in five or more years), I do so with the utmost scorn. Sure, I still use IE7 for personal use (it’s still my default…FF3 takes too long to load thanks to Microsoft, I’m sure) but when I want a stable browser to browse with (did I mention my IE7 crashes and hangs randomly now?) I’m sticking with FF3. That new engine is super fast and it supports something Microsoft throws in as a bonus: standards!
What’s the lesson today? The lesson is, when you’re hammering your head against your desk because some CSS or JS isn’t working right in IE7 or 6, consider using the transitional dtd with them. You might solve all your problems with a single DOCTYPE declaration!
kn