Saturday, May 23, 2009

asp.net development on a mac

Well, sort off…

The idea is that you have designer types who hate windows and will get ill with prolonged usage. So as to make sure you have an adequate supply and flow of decent mark up coming your way as a developer it’s in your best interests to ensure designer type is safely ensconced within the comfort zone of single button mice and strange looking speakers.

We use team foundation server, otherwise known as TFS, which helps us to manage the source control of all our development efforts. In addition, it helps us manage work items (tasks and bugs) during software projects.

If you are on a Mac and are working with TFS, you need this:
http://www.teamprise.com/products/explorer/

OK, so you can work with source control and work items, big deal, how do you actually run an asp.net website?. Well, thanks to the wonders of virtualisation you simply run a windows vm with an iis website as required and give it an appropriate host header such as macdebug.projectname.mycompany.net. Ensure FTP server is running on your windows vm with an appropriate login so that you can copy files to this website via ftp from your Mac.

Now, back on your good old macintosh, you create a TFS workspace and get latest on your lovely TFS solution to have the files locally on your mac. You use your favourite text or html editor and work on the files, checking them out and in as required, and doing all your work items, great. Obviously visual studio is the tool of choice for .net development but if all your tasks are around working with content assets, mark up and styling related files then you don’t really need all that overhead.

All you need to do is ensure that for each change you make that you have an action to FTP the file that has been changed across to the IIS website via FTP automatically. This ensures that you have the IIS website running off your latest changes.

Last thing you need to do is create a hosts file entry on your mac to point macdebug.projectname.mycompany.net to the IP address of your windows vm. Then you can fire up safari and browse to http:macdebug.projectname.mycompany.net to see your asp.net website!

I’ll post up some visuals and details on the tools we’re using on the mac when I have them.

Saturday, May 23, 2009 6:41:29 PM (New Zealand Standard Time, UTC+12:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Friday, May 22, 2009

Expression for Arts Sake

Friday, May 22, 2009 10:14:59 PM (New Zealand Standard Time, UTC+12:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Saturday, May 16, 2009

Where is my mind Wolfram?

image

Saturday, May 16, 2009 2:46:27 PM (New Zealand Standard Time, UTC+12:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, May 13, 2009

Lia Rose Patton – 28 Weeks

Lia Rose - 28 Weeks

Wednesday, May 13, 2009 10:32:55 PM (New Zealand Standard Time, UTC+12:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Saturday, May 02, 2009

Tommy Pics from April

Here’s a collection of pics from my phone i forgot to upload before.

Payback time! Tommy can now bring the bins in, one less job for me on Friday afternoon;)

Tommy Strong Man

Tommy got an easel for his birthday, he loves drawing on this, wiping it clean and saying “good as new”

26042009734260420097332604200973226042009731

The famouse Earthrace 100% biodiesel thingy that went around the world was in Paunaui last month

 

110420097291104200972811042009726

 

Tommy and Freya on their Wiggles date

290320097252903200972429032009723290320097212803200971628032009715

Tommy at Rainbow’s end…

150320097131503200971115032009710

150320097091503200970814032009707

Tommy at Hugh’s birthday party

1403200970614032009705140320097041403200970308032009701Tommy Birthday Pirate01032009694

Saturday, May 02, 2009 2:59:02 PM (New Zealand Standard Time, UTC+12:00)  #    Disclaimer  |  Comments [0]  |  Trackback

IE8 Customisation – Moving Stop and Refresh Icons next to Back and Forward

I just started playing with Windows 7 RC1 and thought, i know i’ll try IE8 again, see if they’ve fixed up the main usability thing that was always annoying me which was the way the Stop and Refresh icons were on the other side of the browser from the back and forward icons.

After struggling with the Tools menu i came across this blog post.

http://blogs.msdn.com/ie/archive/2009/04/20/customization-in-ie8.aspx

Right-click IE8 command bar then select Customise > 'Show Stop and Refresh Icons before Address Bar’

If you remove all the toolbars you get a really clean interface with all the navigation buttons next to one another.

 

image

Saturday, May 02, 2009 2:29:09 PM (New Zealand Standard Time, UTC+12:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Saturday, April 18, 2009

IIS7 Extensionless Urls and Kentico CMS 4.0

Disclaimer: This post contains unsupported guideline for configuring your Kentico CMS 4.x to utilise extensionless urls with IIS 7.0. Use with care!

Base System Requirements: IIS 7.0 with .net 3.5 SP1 on a Windows Vista dev machine or Windows 2008 server to utilise extensionless urls.

Firstly, install the marvellous IIS 7.0 URL Rewrite Module
Get it here: http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1692
Learn about it here: http://learn.iis.net/page.aspx/460/using-url-rewrite-module/

Now, make sure Kentico is configured not to interefere with things…

Kentico automatically applies a filter to the form tags. You need to disable this here:

  • Site Manager > Settings > Output Filters >
  • Ensure the ‘Excluded output form filter URLs’ value is set to a single forward slash.. /
  • Site Manager > Settings > Urls>
  • Ensure the Friendly Url Extensions value is blank

There is currently no way of ensuring that automatically generated urls from Kentico contain a trailing slash. The user must set the Document UrlPath for each page in Page > Properties > Urls to include the trailing slash. However the trailing slash is enforced via in IIS 7 rewriting rule. It is hoped that a future version of Kentico will allow for this to avoid the extra 301 redirect.

Now apply the following website configuration….

Place the following code in the Page_Load of your master page.
            // ensure we fix up the form action if required
            if (!String.IsNullOrEmpty(Request.ServerVariables["HTTP_X_ORIGINAL_URL"]))
            {
                form1.Action = Request.ServerVariables["HTTP_X_ORIGINAL_URL"];
            }

This ensures that Asp.Net postback and ajax work correctly with the IIS7 URL Rewrite Module

Now all you need to do now is apply whatever special rewriting rule syou like within the web.config, utilising the IIS Rewrite Module’s capabilities as you need them. (Note that you don’t need to do anything within IIS, you can manage everything within the web.config and simply deploy it out to target servers without worrying about any additional configuration).

For example, the EnforceTrailingSlash rule below will ensure that a trailing slash is added to all urls without extensions, performing a 301 redirect in the process. This is so to avoid multiple urls (ones with and without slashes) returning the same content which isn’t ideal from an SEO perspective.

The TrailingSlashToAspx rule below will ensure that a trailing slash is rewritten internally to .aspx, so that the kentico rewriting engine can take over. Note that the Kentico CMS folders are ignored (ones starting with CMS..)

<system.webServer>
        <rewrite>
            <rules>
                <rule name=”EnforceTrailingSlash”>
                    <match url=”^(.*)$” ignoreCase=”false” />
                    <conditions>
                        <add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” />
                        <add input=”{REQUEST_URI}” negate=”true” pattern=”(.*)\.([a-zA-Z]+)(\?.*)?$” />
                        <add input=”{REQUEST_URI}” negate=”true” pattern=”(.*)/$” />                       
                    </conditions>
                    <action type=”Redirect” url=”{R:1}/” redirectType=”Permanent” />
                </rule>

                <rule name=”TrailingSlashToAspx”>
                    <match url=”^(.*)/$” />
                    <conditions>
                        <add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” />
                        <add input=”{REQUEST_URI}” negate=”true” pattern=”/cms(.*)$” />
                        <add input=”{REQUEST_URI}” negate=”true” pattern=”^(.*)/\.aspx[#\w=\|\&amp;%-]*$” />
                    </conditions>
                    <action type=”Rewrite” url=”{R:1}.aspx” />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>

And so there you have it, a relatively painless way to get yourself all SEOd with IIS 7.0 and Kentico CMS 4.0.

Saturday, April 18, 2009 10:06:50 PM (New Zealand Standard Time, UTC+12:00)  #    Disclaimer  |  Comments [1]  |  Trackback

Tommy’s 3rd Birthday

2009-04-18 2009-04-18 001 0062009-04-18 2009-04-18 001 0042009-04-18 2009-04-18 001 0022009-04-18 2009-04-18 001 001DSC03805DSC03804DSC03803DSC03802DSC03801DSC03800DSC03799DSC03798DSC03797DSC03796DSC03795DSC03794DSC03794DSC03793DSC03792DSC03791DSC03790DSC03789DSC03788DSC03787DSC03786DSC03785DSC03784DSC03783

Saturday, April 18, 2009 9:20:57 PM (New Zealand Standard Time, UTC+12:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Friday, April 10, 2009

Yellow Maps now live

We’ve just launched another brand spanking new website for Yellow in Yellow Maps. It gives you the ability to do general map and direction searches a la Google but also do specific yellow business listing searches. You can layer on points of interest and see these pop up on your directions from one place to another.

The site was built using Kentico CMS 4, .Net 3.5 SP1, JQuery and the Yellow and Google APIs. Thanks to Calvin, Darren, Campbell and late night pizza from Hell we made it!

Friday, April 10, 2009 1:25:21 PM (New Zealand Standard Time, UTC+12:00)  #    Disclaimer  |  Comments [4]  |  Trackback
 Thursday, April 09, 2009

Quick update

Just a quick post, 1.31am and the rain is battering down outside. I’m up late squishing bugs for another site launch tomorrow and am enjoying the benefits of our new air con system that was put in last week. Went to a parents evening at the day care centre today. Was really tired and wasn’t really feeling like it but it was really great to hear other people and the teachers talk about Tommy. When i got back i told him how proud I was of him and he looked really chuffed with himself and told me loads of stories about what he does at nursery. Normally he says “nothing” when i ask him what he’s been doing (i know, and he’s only 2).

Thursday, April 09, 2009 2:12:01 AM (New Zealand Standard Time, UTC+12:00)  #    Disclaimer  |  Comments [0]  |  Trackback