Updates from March, 2011 Toggle Comment Threads | Keyboard Shortcuts

  • Steve Lydford 12:42 am on March 19, 2011 Permalink | Reply
    Tags: ,   

    First look at Microsoft Visual Studio LightSwitch 

    Illuminate Me

    (See what I did there?)

    Visual Studio LightSwitch is a new platform designed to make it simpler to create line-of-business applications for the desktop and the cloud.

    It is currently in Beta 2 and can be downloaded from the Microsoft site free of charge.

    LightSwitch contains pre-configured screen templates and other re-usable components to handle many routine business application tasks. You can write code in C# or VB.NET and deploy it to the desktop, web or Windows Azure.

    So that’s enough of the marketing headlines, you can read plenty more of them on the official web site, let’s have a go at making something and see what it is really like….

     

    Getting Started

    Once you have downloaded and installed LightSwitch (you must have Visual Studio SP1 installed first), open Visual Studio and you will notice a new set of templates under LightSwitch.

     

    lsNewProject

     

    Choose your preferred language, give your app a name and click ‘OK’. This will take you to the LightSwitch Home Page (View > Home Page).

    From the Home Page you can choose to connect to an existing external datasource, such as MS SQL Server (no support for Stored Procedures at present), SharePoint or a WCF RIA Service, or create a new table in an internal SQL Express database.

     

    Defining the Data

    Choose the ‘Create new table’ option and add the following fields:

    Name Type Required
    Surname String Y
    Forenames String Y
    Phone Phone Number Y
    Email Email Address Y

    Click the title of the table in the Data Designer or Properties Window and change it to “Contacts” and save the table.

     

    lsDesignerToolbar 
    Next, click the ‘New Table’ button in the Application Designer toolbar and create the following table and name it ‘Companies’:

    Name Type Required
    Name String Y
    Address String Y
    Town String Y
    County String Y
    Postcode String Y
    RenewalDate Date Y

     

    Finally, click the ‘Relationship…’ button in the Designer toolbar and configure the relationship as follows:

     

    lsRelationships

     

    Adding a Screen

    When you click the ‘Screen…’ button in the Designer toolbar, you will be shown this dialog:

    lsAddScreen

     

    Choose a ‘List and Details Screen’ and set the Screen Data to ‘Companies Set’. Ensure that the check boxes to include both sets of additional data are checked and click ‘OK’ to add the screen to the application. This will take you to the Screen Designer, which displays a representation of the layout and commands for the screen:

     

    lsScreenDesigner

    But don’t worry about the Screen Designer right now – we can have a look at all that another day. For now let’s just run the application…

     

    The Result

    The application created for us by LightSwitch allows us to view our company contact data in a master-detail format and has a lot of functionality for very little effort:

     

     lsAppHome

     

    We can add, edit and delete companies and contacts, as well as performing various other tasks such as searching and exporting:

     

    lsAddCompany

     

    And the user interface contains some basic validation, based on the data we defined:

     

    lsValidation 

    Conclusion

    There has been a mixed reception to LightSwitch from the developer community, with many perhaps justifiably worried that it may lead to a new plaque of ‘Office Expert’ Access Forms-style mini-applications of the type that many organisations have tried so hard to eradicate. However, there is no doubting that this is a very impressive piece of technology that allow you to build a functional application very quickly.

    As I mentioned at the beginning of the post, LightSwitch apps run in C# or VB.NET and can use a variety of datasources, so perhaps the instructions to the ‘Office Experts’ should be as Dave Mendlen, Microsoft Senior Director of Developer Tools and Platform Marketing suggests: “if you are going to go rogue, use LightSwitch”. That way at least it can be handed over to a more experienced .NET developer if necessary.

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     
  • Steve Lydford 4:15 pm on February 7, 2011 Permalink | Reply
    Tags: ELMAH, errors,   

    Error Logging and Google Chrome 9.0 

    Today I created an ASP.NET MVC 3 default Web Application with the intention of testing a couple of ideas I had, without making a mess of any actual ‘live’ projects.

    Once the application had been created the next thing I did was to use (the brilliant) NuGet to install the (also brilliant) ELMAH error logging facility. I then ran the application and had a browse around by typing URLs into the Google Chrome Omnibox (Address Bar to you and me). I was somewhat surprised when I browsed to elmah.axd to see a whole bunch of errors, particularly as I hadn’t even had a chance to break anything yet!

     

    elmah

     

    I then recalled the checkbox I had ticked in the Options dialog in Chrome 9 to ‘Enable Instant for faster searching and browsing’.

     

    chrome_options

     

    It seems that, if I am not fast enough when typing URLs into the address bar, Chrome requests pages from my application that don’t exist and these are being logged by ELMAH. In fact, you can catch a brief glimpse of a 404 as you type, if you get the timing right. A quick test by disabling ‘Instant’ proves this theory.

    This will (should!) not be a problem for deployed sites, but is annoying for locally hosted applications as it makes it hard to ‘see the wood for trees’. If you are desperate to keep ‘Instant’ enabled you can, if you like, filter out the ‘not found’ errors programmatically during development with the following code:

     

    
    void ErrorLog_Filtering(object sender, ExceptionFilterEventArgs e)
    {
        if (Request.IsLocal)
        {
            if ((e.Exception.GetType() == typeof(HttpException)) && (((HttpException)e.Exception.GetBaseException()).GetHttpCode() == 404))
                e.Dismiss();
        }
    }
    

    You must bear in mind though that it you use this code it will filter out ALL 404 errors on the local machine during testing, so you should use another strategy to compensate for this.

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     
    • Betty 10:18 am on February 9, 2011 Permalink

      Surely they’re just HEAD requests and not full GET requests, couldn’t you filter it that way?

    • Steve Lydford 10:45 am on February 10, 2011 Permalink

      @ Betty. I was getting back 404 error pages as I typed, so surely full GET requests. As if, using the top line from the ELMAH screenshot abouve, I had actually browsed to http://localhost/e

  • Steve Lydford 11:18 am on February 3, 2011 Permalink | Reply
    Tags: ,   

    What’s Happening to Reflector? 

    So Red Gate have made the announcement that the next version of their excellent Reflector application will be a “paid for” product. This is OK, I totally understand the reasons for this – they have a business to run and have tried the free model, but it’s just not working out for them.

    Neil Davidson, Co-CEO of Red Gate Software said this in an “Open Letter to the .NET Community“:

    “As many of you know, our original intention was to maintain .NET Reflector as a free tool. But, after two-and-a-half years of providing it without charge, we realized that we could not make the free model work. We know that this will cause pain for some people in the .NET community, and we apologize for the change in policy.”

    So my initial thoughts were, “You know what? It’s only $35 and I have been using it free for a couple of years, so I’ll take the hit if I want to upgrade. No hard feelings.”

    And then I read this in the FAQs:

    “A free version will be available for download until the release of Version 7, scheduled for early March. The free version will continue working until May 30, 2011.”

    So the version I have on my machine will cease to function on the 30th May!

    I will spend $35 on the new version, but I won’t be happy doing it, I have little choice. I like Reflector, a lot of people do. It is a very useful tool for looking behind the scenes of an assembly to see whats going on (both for debugging and educational purposes). I recommended it as an essential .NET development tool in my last blog post.

    In my opinion, disabling the free version of the software on 30th May is not a good way to go. Why not make the new version so awesome that I NEED it? Don’t FORCE me to begrudgingly pay you money – make me WANT to pay you for an even better product. Maybe the new release is going to be that good, but let me decide for myself.

    You have only got to look at Twitter or search around a few blogs to see that this has already annoyed a lot of people. All that Red Gate is doing is giving someone the incentive to start, or improve an existing Open Source project (like Monoflector) to give equivalent functionality because they don’t give out a free version anymore. Someone could make a big name for themselves by writing the new Reflector.

    I hope that Red Gate have a strategy re-think. Reflect on it, if you will.

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     
    • Alex 9:32 pm on February 4, 2011 Permalink

      Well, JetBrains has ‘hinted’ at the fact that they may be including a ‘Reflector’ in ReSharper. It’s also not free, but if you already are using ReSharper (like me), it’s one less thing to buy…

  • Steve Lydford 4:02 pm on January 31, 2011 Permalink | Reply
    Tags: ,   

    My Developer Toolbox 

    I guess the title of my blog is a giveaway to the fact that I am primarily an ASP.NET developer; at the moment mostly MVC 3, which is all kinds of awesome, for all kinds of reasons.

    So here is a list of the tools that I can’t do without and that I think would be useful for anyone else out there who is wanting to build web apps on the Microsoft stack. This is the stuff that I would automatically install onto a new machine before I started development work on it.

    Post any tools you love in the comments and I will check them out. I’ll keep the list updated as I find new cool stuff ™, so keep checking back. So here they are, in the order that my mind blurted them out:

     

    Microsoft Visual Studio 2010

    http://www.microsoft.com/visualstudio/en-us

    It’s Visual Studio. If you can afford it get it – it’s the best. If not, have a look at BizSpark, WebsiteSpark or Visual Web Developer 2010 Express (below).


    Microsoft Visual Web Developer 2010 Express

    http://www.microsoft.com/express/Downloads/

    The Microsoft Express products are basically FREE cut-down versions of full applications (in this case Visual Studio 2010). It is not as feature-rich as Visual Studio, but has all the tools necessary to develop ASP.NET applications. Ideal if you are a hobbyist programmer or a student. All projects created in Visual Web Developer Express 2010 are compatible with Visual Studio 2010. And did I mention it’s FREE?


    Notepad++

    http://notepad-plus-plus.org/

    Notepad++ is a free code editor, designed as a replacement for Windows Notepad with code syntax highlighting. Ideal for those times when you just want to edit a bit of source code, some HTML, or some CSS without having to fire up the whole of Visual Studio.


    NuGet

    http://nuget.codeplex.com/

    NuGet is a free open-source package manager for Visual Studio and Visual Web Developer Express that just makes it so ridiculously easy to integrate third-party libraries and tools into your projects it is untrue. Truly brilliant, I can’t recommend this enough.

    Take a look at this brief introduction to NuGet by Phil Haack (note that this is for an older version)

    Firebug and IE8 Developer Tools

    http://getfirebug.com/ or press F12 in IE8

    Firebug and the IE8 Developer Tools both do essentially the same job, although each has it’s own strengths – they both let you inspect the source code, CSS and Scripts of any web page and any element within it. This is a fantastic way to learn how other developers have achieved a certain CSS effect or to inspect your output at runtime to find out what is really going on.


    .NET Reflector

    http://www.red-gate.com/products/dotnet-development/reflector/

    Another tool aimed at helping you to find out what is really going on. Reflector enables you to analyse compiled .NET assemblies in C#, Visual Basic and MSIL and is an invaluable learning and debugging tool.


    Ninject

    http://ninject.org/

    I love Ninject. It is a Dependency Injection container which makes it possible to achieve real separation of concerns between your applications components. Ninject is very easy to use and does a good job of all the usual dependency chain resolution and object lifetime management stuff that you would expect from a DI container. Also very simple to install, thanks to NuGet!


    NUnit

    http://www.nunit.org/

    NUnit is a unit-testing framework for .NET, ported from JUnit – the popular Java based framework. This is a completely standalone product, which is particularly useful if you are using Visual Web Developer 2010 Express which has no built in unit-testing.


    Moq

    http://code.google.com/p/moq/

    If you are doing Test Driven Development then life is going to be even harder without a good mocking library. Moq is one.


    Fiddler

    http://www.fiddler2.com/fiddler2/

    Fiddler allows you to inspect all incoming and outgoing HTTP traffic. I find this particularly useful for debugging ASP.NET applications on your local machine by inspecting the HTTP requests and responses to localhost to look at cookies, header information, etc.


    ELMAH

    http://code.google.com/p/elmah/

    ELMAH stands for Error Logging Modules and Handlers and is an open-source error logging facility for ASP.NET. It will log almost any unhandled exceptions and display them back to you via the web. In many cases you can look back to see the original "Yellow Screen of Death", even if you have customErrors turned off. If you have NuGet installed (which you really should), just type “install-package elmah” into the Package Manager Console” and browse to elmah.axd to see the error logs. It really is that easy.


    FileZilla

    http://filezilla-project.org/

    At some point you gotta ship stuff right? And to the web developer that means uploading it. Well there are loads of free FTP solutions out there, but my favourite at the moment is FileZilla.


    SketchFlow

    http://www.microsoft.com/expression/products/SketchFlow_OverView.aspx

    SketchFlow is a prototyping tool released by Microsoft as part of Expression Studio. It gives you the ability to quickly map out workflow and basic functionality to show end users, without having them concentrate on the UI. For once you may get some useful feedback instead of, "Can we try that in green?".


    XMind

    http://www.xmind.net/

    I was never a fan of mind-mapping, but I sat at in a meeting with an avid user of XMind and was very impressed. I have used it a few times since just to blurt out all my "neat ideas" about an application before I start a more formal design.


    Ultramon

    http://www.realtimesoft.com/ultramon/

    If you are a real hardcore developer you will run at least two monitors. I run three and I don’t think I could go back to anything less than that now. Windows can handle all this extended desktop goodness for you, but Ultramon just does a far, far better job. Go and download the free trial and you’ll see what I mean.

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     
  • Steve Lydford 11:59 am on September 15, 2010 Permalink | Reply
    Tags: ,   

    Internet Explorer 9 Preview 

    IE9 Beta became available on the Microsoft website, here:

    http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=3273f215-a733-4f64-b614-560abfed490c

    Full of HTML5 and CSS3 goodness, this may be Microsoft’s last chance to claw back some of the market share it has lost in the last 2 or 3 years to Firefox, Chrome et al.

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     
  • Steve Lydford 10:37 am on August 10, 2010 Permalink | Reply
    Tags: , ,   

    ASP.Net MVC 3 Preview 1 

    Wow, these guys move fast!

    ASP.NET MVC 3 Preview 1 has been released on CodePlex. This release includes global Action filters, support for the new .Net 4 Data Annotation and Validation attributes and the Razor View Engine which everyone has been blogging about in the last few weeks.

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     
  • Steve Lydford 1:48 pm on July 19, 2010 Permalink | Reply
    Tags: IIS, , SEO   

    IIS SEO Toolkit 

    Okay, so your site looks great, you have loads of useful content and your User Interface is life-changing, so why is no-one visiting it? Well, the chances are that your site doesn’t look so great to search engines. This is where Search Engine Optimisation (SEO) comes into effect.

    There are many, many companies out there offering to increase your search engine rankings for (sometimes a considerable amount of) money. There are also a plethora of sites offering advice and several tools available which will analyse your site for SEO. However, most of these tools either charge or offer only a small toolset for a free version and we all know that advice from the Internet can mean a lot of trawling for fact/fiction, currency and usefulness.

    So, in steps Microsoft with its free SEO Toolkit. The tool plugs straight in to IIS and can be used to crawl your site and give you really in-depth analysis of exactly what a visiting search engine spider sees when it visits your site.

    SEO Report

    Now I’ve tried a few existing pieces of SEO software in the past but none of them has given me the ability to access all this information and certainly not in the way that this toolkit does. The SEO Toolkit allows you to build queries on the data and produce totally custom reports on it, along with a bunch of other really great features.

    SEO Query

    Microsoft have been releasing some really great tools for web developers recently, at a seemingly relentless pace, and this one from the IIS Team is right up there with the best of them. This video by Scott Hanselman will show you what I mean…

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     
  • Steve Lydford 1:29 pm on July 13, 2010 Permalink | Reply
    Tags: Android,   

    App Inventor for Android 

    Today Google Labs have started extending invitations to the public for use of their App Inventor for Android software.

    App Inventor for Android allows anyone to easily create mobile applications for Android phones and devices. It is a “no code” drag-and-drop style interface which is used to visually design the way an app looks and use building blocks to define behaviours.

    Blocks have been created for just about everything that can be done on an Android powered device. App Inventor can be used to perform user interactions, store data, send texts, get GPS data, access Google Maps and communicate with web sites such as Amazon and Twitter.

    It looks pretty cool, although as a programmer I have reservations about the whole “no code” business. I’ll give it a go though and report back with my findings. I’d also be interested to know if you have any good or bad experiences with it.

    The Android Marketplace is really beginning to gain ground on the Apple App Store, so this looks like it could be a great way to get in on the action for a small effort.

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     
  • Steve Lydford 12:25 pm on July 9, 2010 Permalink | Reply
    Tags: css3, ,   

    Firefox 4 Beta 1 Released 

    Mozilla have released the Beta 1 version of Firefox 4. The specification looks great and includes support for HTML5 video and WebM format HD video, further support for CSS 3, crash protection, a new Add-Ons manager, a new SDK called JetPack, an Indexed DB for developers to use to store data locally and a brand new User Interface.

    I have been using it for a few hours and it seems to be a great upgrade. The new UI is only available for Windows users at the moment, with Mac and Linux versions to follow soon.

    image

    You can take a look at the new features at http://www.mozilla.com/en-US/firefox/beta/features/ and get a download of the Beta 1 version at http://www.mozilla.com/en-US/firefox/beta/

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     
  • Steve Lydford 4:20 pm on July 2, 2010 Permalink | Reply
    Tags: , ,   

    Small Basic – Programming for Kids (Bring out the Turtle!) 

    My eldest son has been asking me for ages to teach him some programming. I remember learning to program in BASIC on a Sinclair Spectrum and using LOGO on the BBC Micro’s in school and was looking for something as simple as that for him to start to learn with. I didn’t want to scare him off with a jump straight into some OOP language and the complexities of a modern IDE.

    I also considered showing him some HTML, but he really wanted to program and I didn’t want to confuse him straight away with differences between presentation and logic etc.

    Microsoft Small Basic

    After a surprisingly long search, at one point of which I had decided that I was going to write something myself, I found Small Basic from Microsoft. It looks like it is exactly what I wanted. It can be found in the Kid’s Corner section of the MSDN Beginner Developer Learning Center, which also has a lot of great articles, videos, learning programmes and links to other useful resources.

    Microsoft Small Basic

    Small Basic is currently in version 0.9, which probably explains why it has not got a massive presence web yet, and has support for BASIC and LOGO. Perfect!

    Microsoft have provided a blog and forums for support. The first post in the Small Basic blog explains some of the history of the project and shows that I was not the only one struggling to find a good way to teach my kids to program.

    We are going to start this weekend, I’ll blog about our experiences and progress. I can’t wait! Wish us luck!

    BRING OUT THE TURTLE….

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     
    • Yobe wa Kanyenda 7:31 am on January 12, 2011 Permalink

      Thanks for the insight. Just downloaded and installed Small Basic. Run the quick Turtle program – simply magnifique!

      Looking forward to reading about your experiences. I have been in a similar situation with my two daughters (12 and 10) who have been bugging me to teach them programming. I looked at Scratch and Alice, but I could not get round to dedicating time to getting accustomed to the products since I have been programming in Visual Basic 6 for about 8 years now (my whole programming career) – old habits die hard, I suppose. I have only moved to the .NET platform on C# some two and half years back and you can see my predicament

      The best of luck

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
esc
cancel