I’m doing my first ‘real’ ASP.NET project this summer at my internship. ‘Real’ in this case meaning ‘from scratch and not based on modifying/copying/adapting existing code’. I thought I knew a fair amount earlier, but there were some little things that I learned that may be of interest to others just starting out. (I learned plenty of big things, too, but those deserve their own posts.)
#1 : Viewing the contents of a DLL in Visual Studio
(“Contents” meaning “list of functions and members, etc.”, not “code”.) I was having issues finding this, maybe someone else was too? Or maybe it’s just me… Gotta learn it sometime, though!
– Use the object browser: Either press Ctrl-Alt-J or go to View > Object Browser.
– If your DLL is not listed, click the ‘…’ next to the Browse box.
– Select your DLL: Viola! You can now browse the functions and whatnot.
#2 : make sure your application is, in fact, running as an application.
Yeah, this was a big “D’oh!” moment, but a critical lesson for me (at my on-campus job, somebody else had already set up the website so I never had reason to find this out).
My site was working fine for a while, until I tried to enable AJAX for my Telerik components. Nothing worked. I had the hardest time figuring out why – I even downloaded a working example, which promptly ‘broke’ on my machine.
Somehow I finally got the idea that perhaps it had to be set up as an application. Ok, easy enough: I go into IIS, right-click on the folder, click “Convert to Application”, click “OK” on the dialog box.
It gave me a 503 error: the service is unavailable. What?! Turns out the problem was, I glibly clicked through with the default options – and the DefaultAppPool. To fix this, I went into the advanced settings for the application and changed the Application Pool to “default” (the name of the website it was under). Better yet – avoid the problem from the start by selecting the correct application pool when the dialog box pops up after you click “Convert to Application”.
#3 : If at first you don’t succeed… reload.
This is pretty basic, but don’t forget to clear the cache, especially when you’re dealing with CSS or JavaScript. On numerous occasions I’ve hit F5 and gotten extremely frustrated at my perfect code not working – only to realize that the only problem was that the browser hadn’t reloaded the changed code. The solution: make it a habit to use Ctrl-F5 when developing. It reloads everything, including your fresh CSS and JavaScript files.
Similarly, I’ve had issues with SQL Developer giving me the error:
Errors for PROCEDURE my_proc:
LINE/COL ERROR
-------- -----------------------------------------------------------------
287/14 PLS-00103: Encountered the symbol "end-of-file" when expecting
one of the following:
; The symbol ";" was substituted for "end-of-file" to continue.
This frustrated me to no end, and I realized something was fishy when I was copied-and-pasted existing, valid procedures and got the same error. It usually fixes itself if I restart SQL Developer. But in reality, I usually end up using it for the syntax highlighting and browsing stored procedures, users, etc. (I have yet to find an easy way to list procedures for Oracle – MySQL wins [imo] in that arena) and just paste the code into SQL*Plus.
(Coincidentally, I have a batfile set up for that with my login, so I just have to type ‘ora’ and the prompt shows up. It’s not laziness, it’s efficiency!)