# Wednesday, July 02, 2008

ASP.NET - The name xxx does not exist in the current context

I recently converted a Web Site to a Web Application project, and as it had been a while I tripped up on a few things. 

First of all I made the mistake of creating a new Web Application and pasting all the web files in there (I was intending to split some of the site into another Class Library), and I wanted to port to another file structure.  I mistakenly thought it would be easier to do this 'before' changing to the WAP.

I then of course got a gazillion compiler errors (well - 1436 to be exact) on the new project.  The vast majority of which were 'The name xxx does not exist in the current context'.  Yes it does! (I protested).  Well.  That showed mistake number 2.

If you want to convert then use the 'Convert to Web Application' option on the Web Site properties (or on the individual pages if necessary).  This does a number of things:
  1. Sorts out your project structure
  2. Changes 'CodeFile' to 'CodeBehind' and other directives
  3. Adds a designer file for pages and controls
  4. Other stuff that you shouldn't bother yourself with etc...
The compiler errors were due to the fact that the WAP model expects pages to be structured in a certain way, and although the 'code' looks fine (and Resharper was green all the way) it won't compile 'cos the designer files are missing and hence so are the definitions the compiler's looking for.

See Steven Smith's post on some other tips for converting projects.

posted on Wednesday, July 02, 2008 11:07:48 AM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0]
# Monday, June 30, 2008

Del.icio.us - FavPal.NET is dead?

This sounds pretty unlikely, but I'm a new (and very enthusiastic) del.icio.us user (and have to think hard about where to put the dots every time I type it).  I guess you can't jump on 'every' bandwagon.  I tend to discover stuff that I 'need' these days rather than get too 'wowed' by yet another networking site.

I developed a tool called FavPal.NET (don't worry - I'm sure you haven't heard of it!), a few years back as I saw there was nothing that allowed you to search through browser bookmarks with any degree of speed or accuracy.  It was a tray app that kept a 'cache' pool of IE instances (as load time was pretty bad back then), and allowed you to search through your favourites, then load up URL's into a cached instance in double-quick time.  This served two purposes

  1. Search Favourites
  2. Load IE quickly

Del.icio.us obviously more than scores with requirement 1 as it allows you to keep your bookmarks centrally (BTW - I also use the IGoogle bookmarks gadget for 'home page' access to my most frequently used stuff).  One thing was still lacking - an 'integrated' search within the browser (or rather a search without having to point your browser to del.icio.us), but now there's an IE extension (for IE6/7) that sits as a sidebar (nice).

I noticed there's a Delicious.NET framework, and I'm still not terribly satisfied with the initial application load speed of any browser (even Firefox and Safari), so maybe FavPal's not quite dead.  The search functionality could now simply hook into del.icio.us and still use the cache.  With tabbed browsing on IE7 now though the object model may well have changed.  If anyone wants to have a crack at it you're more than welcome, and I'll send you the code, as it got removed from the late lamented gotdotnet workspaces.

Of course the load speed will ineviatably go up with the more plugins like del.icio.us you bloat the browser with - d'oh!

posted on Monday, June 30, 2008 8:24:27 AM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0]
# Thursday, June 19, 2008

Developer Highway Code - Building secure software with .NET

Had some security training yesterday (don't normally get training as a contractor so I was very happy to go along). 

The trainer mentioned the Developer Highway Code from Microsoft (seemingly originating from the UK based on the style of the publication).  Not only does it look cool, and have some rather amusing geek stuff (just see the 'Reduce Coffee Now' sign on the cover), it also has some really practical advice for people wanting to build secure applications.

Download it from Microsoft

posted on Thursday, June 19, 2008 10:23:35 AM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0]
# Monday, June 16, 2008

If, For, Switch, but...

I love that Scott Hanselman challenges his own as well as others' thoughts on how to solve technical problems.

I'm not making any judgements about junior devs vs. senior devs. I'm talking about idioms and "vocab." I think that using only if, for and switch is the Computer Programmer equivalent of using "like" in every sentence. Like, you know, like, he was all, like, whatever, and I was like, dude, and he was, like, ewh, and I was like meh, you know?

There's some good examples on forcing yourself to learn new objects, features and constructs through refactoring.  If you don't refactor then you'll never know...

posted on Monday, June 16, 2008 9:32:26 AM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0]
# Friday, June 13, 2008

Installing Multiple versions of Internet Explorer with Multiple_IE

I don't have the time, inclination or grunty machines to play around with Virtual machines just so I can test a website in IE6 (after IE7 'magically' appeared).  When I say 'test', I actually mean hack an IE-specific CSS together with some box-model workarounds.  I digress...

Enter Multiple_IE.  It's not perfect (it's a hack in itself), but it suffices in most cases so kudos for that...  You even get the nostalgia of IE3

posted on Friday, June 13, 2008 2:17:00 PM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0]
# Wednesday, June 11, 2008

Code Monkey Song

I'd totally forgotten about this - don't want to lose it...

http://www.jonathancoulton.com/2006/04/14/thing-a-week-29-code-monkey/

posted on Wednesday, June 11, 2008 10:17:46 AM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0]

Giving Guidance Explorer another go

I downloaded the Patterns and Practices 'Guidance Explorer' a year or more ago, and quite liked the idea.  I think the problem with any tool that tried to be a flexible storage and delivery method for 'organic' content (I'm interested in using it for development processes/standards etc) is viewed and searched by different people in completely different ways. 

Some like to dip into 'reference' material, some always 'search', and some people like to print everything and read cover to cover.  I know there've been some updates to the tool, and although the download count is still pretty low (3000 ish) I'll give it another go and see if it works for me.

Other people just throw this stuff into docs and put it on SharePoint.  Others use something like WikidPad - which again I liked but ultimately got out of the habit of using - meaning it obviously didn't work for me. 

Update

I just noticed that there's no possible way of printing from Guidance Explorer, and so while I can understand the reasons why it isn't implemented (to try and encourage people to write screen-consumable, concise content), it simply won't work for the users I'm looking to target.  Shame :-(

posted on Wednesday, June 11, 2008 9:02:04 AM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0]
# Friday, June 06, 2008

Visual Studio Documentation - Have your say

Brad A's just been highlighting the MSDN Survey to get opinions on how Visual Studio and MSDN documentation works (or doesn't) for people.  I added my 2c and it made me think a little about how I access 'help' these days.  Here's what I wrote in the 'other comments' (Q 14 I think).

I generally access MSDN content through google (as it's quicker than accessing the MSDN site, waiting for it to load the TOC, then searching).  It's probably testament to the indexing of the site that a search such as "msdn Path.Combine" will take me straight to the specific page I 'know' I'm looking for.  I guess this means I've got some knowledge of how things are structured and I use that to good effect.  In a simple comparison...

Local Help
Typing Path.Combine into VS.NET code editor - selecting the text and hitting F1 came up with a false start (my current machine doesn't even have the docs installed apart from Enterprise Library 3.1.  It did find some less than useful reference from EntLib!).  I went to Help options and chose 'use online first', and tried again (incidentally I didn't even realise you could pull in your own list of sites to search (Codezone community) - cool).  It chose a different 'Path property' first and took about a minute in total to get to the right 'Path class'.

MSDN Library Site
Opening up the MSDN site (which still feels too heavy in my book - and now curiously like BBC news) and searching for 'Path.Combine' took about the same time (1 min).  This includes opening the browser, loading up the MSDN home page, searching, clicking the first item in the search results, and loading that page.

Google search on MSDN
Opening up Google (admittedly my home page - but I'm looking for speed here) and searching for 'msdn Path.Combine' took 20 seconds.  The first item in the list was what I wanted so got straight to it.  It's also worth noting that Google's become a little fat puppy too with all my iGoogle stuff on it, but it's still way quicker than any of the alternatives.

 

posted on Friday, June 06, 2008 4:44:22 PM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0]