Monday, September 14, 2009

Day 94: A Writer's Retreat….

Dot .Net Dilemmas

Quite a lot has happened to me since my last blog entry. Some good (I finally passed my driving test – Better late than never), some not so good (both Bohemian FC and Sydney FC have forgotten how to win), and some that I just can’t talk about on a public forum. Overall I am pretty happy how things are starting to work out. As for Project Something, Something well, it hit a bit of a brick wall as I had so many other things going on that I simply couldn’t fit any more hours in to the day to get stuck in to it. But that hasn’t stopped me thinking about it almost every spare moment that I have. I have gone past a lot of the technical questions that I had and now the thing that seems to occupy my mind most is, finding a domain name that explains the product I will provide which hasn't already been registered. It now makes perfect sense why web based companies have names like Yola and Zoho that have no real relevance to the service they provide. Today I watched a DVD called 'Aardvark'd - 12 weeks with Geeks', a documentary about 4 interns working for Fog Creek Software and given 12 weeks to design, develop, debug and deploy the product that became Copilot. They loved the name Copilot but of course the domain name was taken and they ended up paying $10,000 to secure the name. No matter how good a name is, I would never even consider paying that type of money. My brother Philip is the creative one in the family so, I am going to give him the details of my idea and see what he come up with. No pressure mate....

Over the last few days I have really been lucky with ‘finding’ somewhere I will be able to churn out all the lines of code that I need to finally get a working demo that I can show people and (hopefully) get them interested.

My girlfriend and her parents are going overseas for a month and I was asked to housesit their amazing place and look after their two dogs while they are away. So, I am typing this, sitting by the pool in 29 degree Sydney heat while looking out over the most beautiful gardens. I really have struck gold and have no excuses for not locking myself away and with every spare moment hammer out some real solid code and show some progress for all the big noise that I have been making….

I guess for the next while, my blog is bound to get more technical, This is to be expected as I will be nose deep in code for the next 3 months. I have made a commitment to have a shippable product by November 12th and although even at this stage I am not sure if that is realistic, I am certainly going to try.

Thursday, August 27, 2009

Day 77: < Insert Witty Title Here >

Dot .Net Dilemmas

There is a sure feeling that summer is on the way in Sydney. The A-league has kicked off again and Sydney FC look like they may just challenge for honours this season. Sydney FC will never replace Bohemian FC in my heart but I guess it’s like a heroin addict just 'getting by' on methadone. The warmer evening make you feel like you should be doing something with your time (other than working full time and working on Project “Something Something”) so, On Monday night I attended my first Sydney Alt.Net “Lightening Talks”. I knew that there was an Alt.Net group in Sydney but for some reason (which I can not explain), I thought that it was invite only. It isn’t so, on the advice of friend I went along. The meeting was held in Thoughtworks offices on Pitt Street and my first impressions were very positive. It’s a big bright open office, good sized monitors with comfortable chairs at each desk, a well stocked kitchen and work space environment conducive to getting things done. The fact that there was beer,soft drinks and pizza on offer too didn’t hurt when it came to forming my opinion.

Since coming to Sydney,I have found it pretty difficult to find other .NET developers in my general circle to bounce ideas off so, to be in a room with 30 or so likeminded people was a good experience. To date, all the decisions on what technologies that I am using for my product are based on my own personal preference, experience and research so it was exciting to see that some of the choices that I have made were somewhat validated as most of the talks were on ASP.NET MVC, Fluent NHibernate, IoC and JQuery. Of particular interest to me was Damian Maclennan’s 10 minute talk on ‘Making ASP.NET MVC simple with Fluent NHibernate with StructureMap’ and James Crisp’s ‘Securing your ASP.NET MVC site against code injection and x-site scripting’. Largely, I think that the type of people that go along to user group meetings are those that have a real interest and passion for what they do, so to hear them discuss and share their positive experiences of the technologies that I am using gave me much needed and timely encouragement to stay on the path that I am on. At the moment I am working my way through the SportsStore web application created by Steven Sanderson in his new book ‘Pro ASP.NET MVC Framework’. When I have it finished, I plan to migrate it to the Azure Cloud as I think that it will be an excellent exercise to ensure that the Frameworks and technologies that I am using work in the cloud. If there is interest, I think that I will offer to present my finding to a future Alt.Net meeting.

Finally, if you are developing a ASP.NET MVC web application, you will no doubt know the importance of the whole concept of Routing URLs. So, if for no other reason than it's like getting your homework done for you, you should read Chapter 5 of Pro ASP.NET MVC where Sanderson ‘gives’ you a full unit test for both inbound and outbound route mappings that you can simply plug into your own unit tests... Excellent..

Thursday, August 6, 2009

Day 50: Project Something Something Meets BizSpark

Dot .Net Dilemmas

Day 50!!!! I can not believe how quickly the time is going by. I am now really starting to understand why a lot of people who are looking to start their own company, save up a few months salary and take time off before embarking on the ISV adventure. It is not easy to have a full time job (especially when you are on the run-in to a major product release) and put in the time that is required to get a project of this scale up and running. Anyhow, that’s the reason for me not having time to update my blog but not an excuse for not continuing work on my project (which I have a working title of ‘Project Something, Something’ – Don’t ask…)

So one very important thing that I have done since the last update is, I have applied and was accepted to participate in Microsoft’s early stage startup program, BizSparks. I have to admit that this is one of those offers that may seem too good to be true and I spent more than a few hours looking for the ‘catch’ in the offer but I don't think that there is one. As they say themselves, it is Microsoft’s program that provides Software, Support and Visibility for Software Startups. You can expect to get;
  • Software. Receive fast and easy access to current full-featured Microsoft development tools, platform technologies, and production licenses of server products for immediate use in developing and bringing to market innovative and interoperable solutions. There is no upfront cost to enroll.
  • Support. Get connected to Network Partners around the world — incubators, investors, advisors, government agencies and hosters — that are equally involved and vested in software-fueled innovation and entrepreneurship who will provide a wide range of support resources.
  • Visibility. Achieve global visibility to an audience of potential investors, clients and partners
  • As a Microsoft BizSpark member, you’ll be tapping into a rich, vibrant ecosystem of peers, partners and support resources around the globe, helping you grow and succeed. Microsoft BizSpark is the quickest way to get your Startup fired up.
There are a number of conditions of acceptance into the program; your business needs to be:
  1. Developing software - Check
  2. Privately held – Check
  3. Less than 3 years old – Check
  4. Making less than US $1 million annually – (regrettably) Check.
You also have to have a company URL. I was a little worried about this because as yet, even though I have a number of domain names registered, I do not have a business website or even a landing page.

Up step Bob Walsh of 47 Hats. On one of the recent Startup Success Podcasts, Bob suggested that anyone who was looking to get involved in the program and had any questions to simply drop him a line with a brief outline of your startup idea and he would help in the BizSpark sign up process. So, 20 minutes after I completed the email, in which I described my product and explained my concern regarding the lack of a company URL and sent it off to Bob, I got a very prompt reply. Bob is a man of his word.

Two really good things to come out of the correspondence with Bob are. He showed me how to create a very professional landing page using a service call ‘Launch Splash’ until you have your own site up and running. He also thought that my idea was an ‘excellent focus for a Micro-ISV’. He could also see the same potential that I can for future projects based on this one idea. I can’t tell you how much confidence that gave me, as Bob as been very successful with his own Startups and I would say as seen thousands of startup ideas over the years. He has also written a number of books on the topics including ‘Micro-ISV from Vision to Reality’ and his latest offering ‘The Web Startup Success Guide’

Two things that you should know about BizSpark; even though it is a Microsoft program you do not have to develop your software using the Microsoft development stack (but the free software may change your mind about that), it is open to anyone who meet the criteria. Also, the program is only open to new startup for 3 years at which time you are no longer part of the program and have to pay $100 exit fee. Hopefully by that stage, $100 will be less than a minute’s work for you.

I just hope that my BizSpark membership will entitle me to discount Azure rate, now THAT would be cool.


Wednesday, July 22, 2009

Day 35: My Shiny New Azure Account.

Dot .Net Dilemmas

During the week I signed up to join the Microsoft Windows Azure CTP (Community Technology Preview ). Just now, I received an Invitation Code from Microsoft for a Windows Azure account. I feel quite excited about it to be honest and can't wait to get started..

Apparently I have the following limits attached to the agreement:
  • Total Compute Usage: 2000 VM hours
  • Cloud Storage Capacity: 50GB
  • Total Storage Bandwidth: 20GB/day
I was also informed that Microsoft reserve the right to suspend my account activity if I exceed these limits..

I can live with that.. Now onwards and upwards to the cloud....

Monday, July 20, 2009

Day 33: I Have A Dream....

Dot .Net Dilemmas

The approach that I want to take in designing my software is to simply come at it with the end-user clearly at the forefront of my thoughts at all times. The users needs must be in my mind with every design decision that I make. My whole philosophy on software design is that it should be clean and simple, especially at the UI level. Applications that do ‘too much’ may look great and wow people at the start but it can lead to a complexity that can get old very quickly. This complexity can ultimately lead to unmaintainable software. Unmaintainable software is something that I can not have in my design as I plan to have continuous updates and releases to add value for my clients. In my experience users of any software application repeat the same tasks over and over and these basic tasks should be clean, crisp easy to use and above all solid and reliable. You can add the bells and whistles at a later date when your application is rock solid and you have delivered to your clients exactly what it is that they use and need. In a sentence, ‘Everything we do needs to make our product less annoying.’

Seth Godin said...
I hope that my software will be used on a daily basis and for this to become a reality; I have to have it become an essential and intuitive application for the user. My hope is that it is a piece of software that they could (no doubt) survive without but nonetheless software which makes their live so much simpler that, they wouldn’t want to. To paraphrase the marketing guru Seth Godin , ‘what we are selling is ‘Hope’. If people invest in using our software it will give them hope of a better business. The magical thing about selling hope is that it makes everything else work better, every day get better, every project work better.’
Read the actual article here What Marketers Actually Sell.

Putting Myself In Your Shoes... Phew!!!!
The way that I plan to achieve my simple design is:
To think hard about the people who will use my software and put myself in their shoes when I am designing the front-end. I need to stop thinking like a developer and start thinking about it like a user. I will think about each task and try to make the completion of that task a simple and enjoyable experience for the user, be it a 22 year old computer graduate or a 65 year old grandparent.

Years ago while I was taking a driving lesson my instructor told me that you should always drive like you have your mother in the front seat (unless your mother is Sarah Connor from Terminator) . Personally I think that designing a public facing user interface should be handled in much the same way. Think about what issues your mother or grandmother would have if they had to use your application and solve it from their point of view.

Worried that simply user interfaces won’t show off your talents or hook potential users? Well, tell that to Twitter who basically have one text field and an update button. Anyhow, when was the last time you heard of someone not using say, a website because it was two easy to use?

Wednesday, July 15, 2009

Day 28: Dizzy My Head is Spinning!

Dot .Net Dilemmas

There are a number of questions that I have that just keep going around and around in my head so, I have decided that I will write them down, post them on my blog and hopefully over the next few weeks solve each one of them.
Some of these are business process problems and some are application design issues. I have just lumped them all in together and put then here in no particular order.
  1. I plan to provided my software using a SaaS deployment model. I simply don't have (or need) the resources or infrastructure to host the applications for potential clients. I don’t think that it is practical (or advisable based on previous experience) to use a traditional hosting setup so I am looking to the ‘cloud’ to host my applications and services. As yet, I have no idea how to code against the cloud or how much it could potentially cost. I need to decided if I should use Amazon Elastic Cloud EC2 or Microsoft’s Azure (apparently Azure is the colour of the sky on a bright clear day). There may even be other providers that I have, as yet not even considered. I think I heard that you need to write Proprietary Code to use EC2 which would tie me into using it the future. This would be a huge negative. Something that I have heard is, because it is such a new ‘technology’ that you really can not afford to get tied to one provider as they may just pull the plug on it. So, as much as you need an entrance strategy to get onto (into?) the cloud, you equally need a very good exit strategy
  2. It may be a bit down the line but I now need to consider as I move forward with my application design and development, which architecture I will use to to architect my services? Should I use a Mutitenancy or Multi-Instance architecture? If I use Multi-Instance (which I have read is the best way for security and performance) is it as simple as just setting up a virtual directory for each client? Does the cloud even use the concept of IIS and virtual directories? How difficult is it then to manage multiple application instances?
  3. For argument sake, let’s assume that I go down the multi-instance road and that when a new client signs up to use the services, I simply configure a new virtual directory in IIS for that client and copy all the latest code into the folder and away they go. Now I am left with the question of, how do I manage software updates and bug fixes? Again I ask, how do I manage multiple application instances? Is it necassary to take the applications offline and write a script to update all the folders at once? If so, what are the implications of this downtime to my clients?
  4. Equally, if each client has their own database schema, what is the best way to manage code updates or table/field structures changes across all schemas? How do I create daily backups to ensure that my client’s data is backed up and safe?
  5. Do I need to build my admin application to manage and track to best serve my clients?
  6. There will be two distinct but explicitly linked parts to the application that I will offer. I am still not sure of this means that I need to develop 2 separate applications that share the same data or create one application and base its behaviour on the status of the currently logged in user. For example, if a user logs in as the owner of the site, will they just see additional views/fields and have additional functionality? I am not sure if this would lead to an overly complicated design and compromise the security of the site?

I have to say just writing these questions out like this is a great exercise in getting your thoughts clear. Suddenly each of the issues have a bit of structure to them and don’t seem half as daunting as they did 45 minutes ago. Excellent!
I hope to constantly update this list with issues as they arise, solutions as I discover them and decisions as I make them.

Monday, July 13, 2009

Day 26: The More I Learn... The Less I Know.

Dot .Net Dilemmas
A few things that I have learnt since I started this project and of which I am sure will come as no surprise to anyone are;
  1. It really is very difficult to have a fairly stressful full-time job and start a one man project/business (hence the reason that it has taken me so long to update this blog).
  2. Don’t believe all those books and websites that tell you that getting a product to market on the web is simple…. It’s simply not. In fact, this leads me to one other thing that I have found out and that is….
  3. THE MORE I LEARN, THE LESS I KNOW!
I now have a pile of books almost as tall as I am that I either need to, or would like to read but being totally honest, I could spend the next 2 years reading books and still not feel like I am ready to start. That is why I have now got to change the habit of a lifetime and stop procrastinating. I need to actually start producing something and just get it done, get it out there and get some early feedback from the people who may actually want to use it.

In fairness, all the reading and “thinking” has not gone to waste. I do feel that I have the right idea for a product and have identified my potential market. I also think that I have managed to come up with the right pricing structure to get potential clients interested. It’s going to be free. Yes FREE! However, I will explain how I am going to do that at a later date…

Another decision that I have made is, whether this micros-ISV is a success or not, the very least, I want come away from all is having learnt a lot of lessons that I can use in future projects (or if it comes to it, in my next employment.) In my opinion, ‘learning’ is never a waste to time. But just in case I am wrong and learning is in fact a waste of time, I have decided to pick technologies that I have an interested in. So, my application will be developed using the following technologies;
That should keep me pretty busy for a while. You may notice that I haven’t mentioned which database I will use. I plan to make this decision much further down the line when I need to. I am hoping that by implementing NHibernate, not only will it relieve me of the task of writing the mundane CRUD code; I will also me to switch between databases via the application config file but as yet, this is something that I need to look into..

Tuesday, June 23, 2009

Day 6: The Day I Met Martin Fowler.

Dot .Net Dilemmas

I was pretty good with my reading over the weekend and managed to get through the first 4 chapters of Applying Domain-Driven Design and Patterns
Over the next day or two I will update this blog with the notes that I have made from each chapter. I am not sure how much use these will be to others but as much as anything else I want this to be an area where I can look back and see when and why I made certain decisions along the way.

This is just a quick update but as a start-up, I feel that these are two sites and services that I will use over the coming months.

Useful Websites:
  • 99Designs.Com: “Need a logo or a new webpage template designed? 99designs connects business owners with a thriving community of designers, who will compete to create the perfect graphic for you.” You basically start a competition with a small financial reward, where you describe your business idea to a community of graphics designers. You then, hopefully, receive dozens of designs from numerous designers and you choose one to be the winner.
  • UserTesting.Com: Low Cost Usability Testing. You get a video of a user speaking their thoughts on your site as they use it. You also get a written report describing the problems that they found while following your test requirements. Imagine how much more confident you will be on the day you go live, knowing that your design ‘works’ and has past all the Usability tests you set.

Useful Podcast:
Two (of many) Podcast that I have been listening to:

Finally, I purchased a new book today which I believe could be the bible of Web Usability and a MUST for anyone who plans to have a public facing web site or web based product

Friday, June 19, 2009

Day 2: Getting Started on the ‘Elevator Pitch’

Dot .Net Dilemmas

Last night I was reading up on how to create a good ‘Elevator Pitch’. I have to say that I'm not even 100% sure that I need one at this stage. I’m not looking for investment or help from anyone who I would need to ‘sell’ the idea to. However, I do think that it will be a good exercise for me to complete as it will force me to answer some very important questions about what the business should be. It may even have the effect of making me face up to the fact that my idea just won’t sell. I hope not or this could be the shortest-lived Micro-ISV of all time…

I have however, come to the conclusion that I would really like/need to get some help with the ‘Who is your Competition’ question. I know that I could go to Google of Bing and start searching on the web for all the companies and Micro-ISV that will be my competitors and that I will need to keep an eye on. Right now however, I just don't have the business knowhow to assess the success of a business just by looking at their website. I know that perfect person to ask, now all I need to do is get her to say ‘yes’.

I am going to be honest here, this is all very new to me and I am going to do all my learning and make all my mistakes in public so, if I am making stupid mistakes or asking stupid questions, please point them out and if you can, cut me a little slack to begin with.

Thursday, June 18, 2009

Day 1: BPD Micro-ISV

Dot .Net Dilemmas

For a long time how I have been thinking about and working towards starting up my own online business which, I have found out is called a ‘Micro-ISV’ . I don't think that I have a particularly brilliant business brain but, I look around and see that there are a lot of people who are just like me (and some that don't have the same skills that I have) running very successful software business. I think that there comes a time for most people when they would just like to work for themselves. Give it your best shot and see how it goes.
The great thing about having a full-time job is that, within reason, if the company has a bad month or you get sick, you still get paid the same as you did last month. On the negative side, when the company does really well and you’ve worked really, really hard, you STILL get paid the same as last month. I don't think that it takes a genius to figure out that, I will ever get ‘rich’ working for ‘the man'…

Micro-ISV
I really don't like the term 'Micro-ISV' (Eric Sink is to 'blame'; he used it in an article for Chris Sells at Microsoft) but it does explain exactly what the business will be, a small Independent Software Vendor. And in my case a REALLY small Independent Software Vendor. To start with, it will be just me…. But that’s ok.

I have a number of ideas and products that I want to try and bring to market and I have settled on one as my first small footsteps into the world of online business. I won't go into what exactly it is that I hope to develop but, I have noticed a gap in the market in an industry that I have some background in and, I reckon I could help fill that gap (or at least make it a smaller gap).

Over the last few months I have been reading loads and loads of articles and listening to even more podcasts on how best to start an online business and what technologies I should use. However, except for that I honestly am at the very start of this journey and this is going to be my online journal of how I get on. The one thing that I keep hearing over and over is, 'Just get it out there', so that's what I plan to do. I hope to have version one of the product available in roughly 4 months.

This is day 1 – “Blank Page Day”. Hopefully, someday not too far into the future, I will be writing a blogs on how I have just made my first sale, my first year in business, version 2 of my product and hopefully (someday) being able to give up working full-time so that I can concentrate on my own million dollar business.

Although the aim of the business is (and should be) to make money (and lots of it), I hope that I learn a lot along the way. I plan to use a host of new ideas and technologies (new to me anyhow) and maybe some of the things that I learn and mistakes I make along the way will help others who are thinking along the same lines. If nothing else it will be an experience and it should be an exciting one.

Books
Ok, I am currently reading 3 books:
  1. Micro-ISV: From Vision to Reality by Bob Walsh (forwarded by the legend who is Joel Spolky)
  2. Neuro Web Design: What Makes Them Click? by Susan M Weinschenk
  3. Applying Domain-Driven Design and Patterns: With Examples in C# and .NET by Jimmy Nilsson
So, my plan is, by the end of June 2009, I will read all of ‘Neuro Web Design’ which is a very short and easy to read book. I will move my ‘Elevator Pitch’from my head onto paper and finally, I will be reading 1 chapter a day from Jimmy Nilsson’s book, so in 12 days, I will have the book finished and notes on each chapter on here.. All this, and working full-time, meaning that it will be in the evenings and the weekends..

Wish me luck…

Wednesday, April 29, 2009

Visually Impaired? Here, let's try and make this a little more difficult for you.

Dot .Net Dilemmas

I get the need for CAPTCHA on a website but, I really don't like it as a solution to preventing automated site attacks. I see it as real barrier to purchasing online as more often than not, it takes a number of attempts to get the word(s) entered just how the software wants to see it. Unless I really want something, I hit the 'X' in the top left hand corner of the browser. Now I'm a web developer and I find it tricky and annoying so I can only imagine how frustrating it is to someone who is simply trying to purchases tickets online for the first time, to see Celine Dion live in concert.

Now think about how much more difficult the whole process is if you are visually impaired. Recently I was trying to purchase tickets online (not to Celine Dion, I promise) when before the application would even let me know if there were any tickets still available I was hit with this:


I wasn't 100% sure what the words were (even after clicking 'Try another' a few times) so, I had a look around for some help. There right under 'Try another' is 'Vision Impaired' see it?


Don't get me wrong, it is a good idea and anything that helps people with a disability access to the web is a good thing; but just look how small it is... If you are visually impaired and can not see or make out the words in the Security Check, how on earth are you meant to see the tiny 'Vision Impaired' text?

Moving on, let's pretend that I am visually impaired and I have someone who is able to tell me what I should do next close by. I click on 'Vision Impaired' expecting to see the words displayed over the whole page in letter so big that you can make them out from space but no...
What you get next is an even smaller screen, that plays an audio of some numbers (that you are meant to type in to the text box provided) over the tops of some ghost like moaning and whispering.

So, if you are visually impaired, you first have to be able to find the 'Vision Impaired' link. If you some how miraculously find it and click on it, you have to find the play button and then hope that your PC or laptop has a sound card. If it does, you had better hope that your hearing isn't also impaired (it would explain wanting to see Celine Dion in concert) and than you are able to make out the numbers from the ghostly bingo caller.

As I said, I really don't like the CAPTCHA approach (I understand that it is easy to criticise and I haven't come up with anything better) but surely this is an idiotic solution to a very simple problem. If you are expecting people who are visually impaired to use your site, make it so easy for them. Just make the letters and words BIGGER...

Monday, April 27, 2009

It's my party and I'll... keep listening to my iPod if I want to.

Dot .Net Dilemmas

Why do offices (usually HR) insist on having employee birthday celebrations? Ok, I'll admit, I am a bit of a strange one when it comes to forced celebrations (hey, it's your birthday, you HAVE to be happy today... Did you hear me? BE HAPPY!!!!!). However, I can think of few things worse than looking up from my work and having to take my headphones off as the whole office stand around my desk, arms folded with a look on their face that falls somewhere between boredom and pure pain just to wish me a happy birthday.

It's happened in almost every company I've worked in and there is just no need for it. None!!!! It is pointless and simply a management exercise in touchy feely. The majority of people that I know hate it, really, really hate it. Granted, most people I know in a work environment are programmers and they aren't too fond of any social interaction. The worst thing about it all is that I have NO say whatsoever in it happening. It's suppose to be MY birthday yet, I sit here all day feeling slightly ill knowing that at any moment I am going to be surrounded by some people who never really speak to me, but are now going to sing to me...

So, it's my birthday today and I am sitting here writing this and waiting... Waiting and trying to take my mind of what's to come. I now believe strongly that it's not the getting older as to why most people hate their birthday it's waiting, like a man on death row, for the forced office 'celebration' to begin.
Time for my happy face... Tick, tick, tick....

Friday, November 14, 2008

POP-Before-SMTP

Dot .Net Dilemmas

I recently had to move one of my web applications off one hosting provider (that changed their trust levels without informing anyone) and on to a new hosting provider where I could set the trust level in my web.config file. I wanted to keep the web and mail service on the old provider as transferring the domain to the new provider could have meant even more downtime for my client and she really couldn't afford that (who could at the moment?).

Anyhow, all was ok until I was testing the application on the new server, went to purchases some sessions and BANG! Another issue raised its ugly head; 

"The server rejected one or more recipient addresses. The server response was: 450 : Recipient address rejected: Greylisted for 5 minutes"

I contacted my old hosting provider and the response I got back was;
"If a valid POP login is not received before sending mail through the server, then the mail is greylisted and held for 5 minutes before a retry"

To the point but, it didn’t actually explain how I might do this. They actually suggested that;

“The easiest way would be to click on "Send/Receive" in the email software before sending the email."

Even though they knew that the email was being created from within code.

I posted a message on Stackoverflow, and found out that I would basically have to write the code myself, as ‘POP3 is not built into the .NET framework’.

Below is the code that I put in place. Basically, I do a POP-Before-SMTP. This logs me into the POP3 server, my credentials are authenticated and I can send the email that I need to send, immediately after the call. (I tried to put snapshots in here but the quality was awful.)

Ultimately, I will move everything over the new hosting provider (and hopefully talk my client into moving to a dedicated server) but for now, this works perfectly well.

using System;
using System.Collections;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Text;
using System.Text.RegularExpressions;
using System.Diagnostics;

namespace Pop3
{
public class Pop3Client
{
private Pop3Credential m_credential;
private const int m_pop3port = 110;
private const int MAX_BUFFER_READ_SIZE = 256;
private long m_inboxPosition = 0;
private long m_directPosition = -1;
private Socket m_socket = null;
   private Pop3Message m_pop3Message = null;

public Pop3Credential UserDetails
{
set { m_credential = value; }
get { return m_credential; }
}

public string From
{get { return m_pop3Message.From; }}

public string To
{get { return m_pop3Message.To; }}

public string Subject
{get { return m_pop3Message.Subject; }}

public string Body
{get { return m_pop3Message.Body; }}

public IEnumerator MultipartEnumerator
{get { return m_pop3Message.MultipartEnumerator; }}

public bool IsMultipart
{get { return m_pop3Message.IsMultipart; }}


public Pop3Client(string user, string pass, string server)
{m_credential = new Pop3Credential(user,pass,server);}

private Socket GetClientSocket()
{
Socket s = null;

try
{
IPHostEntry hostEntry = null;

// Get host related information.

hostEntry = Dns.GetHostEntry(m_credential.Server);

// Loop through the AddressList to obtain the supported
// AddressFamily. This is to avoid an exception that
// occurs when the host IP Address is not compatible
// with the address family
// (typical in the IPv6 case).

foreach(IPAddress address in hostEntry.AddressList)
{
IPEndPoint ipe = new IPEndPoint(address, m_pop3port);

Socket tempSocket =
new Socket(ipe.AddressFamily,
SocketType.Stream, ProtocolType.Tcp);

tempSocket.Connect(ipe);

if(tempSocket.Connected)
{
// we have a connection.
// return this socket ...
s = tempSocket;
break;
}
else
{
continue;
}
}
}
catch(Exception e)
{
throw new Pop3ConnectException(e.ToString());
}
// throw exception if can't connect ...
if(s == null)
{
throw new Pop3ConnectException("Error : connecting to "
+m_credential.Server);
}
   return s;
}

private string GetPop3String()
{
if(m_socket == null)
{
throw new
Pop3MessageException("Connection to POP3 server is closed");
}

byte[] buffer = new byte[MAX_BUFFER_READ_SIZE];
string line = null;

try
{
int byteCount =
m_socket.Receive(buffer,buffer.Length,0);
line =
Encoding.ASCII.GetString(buffer, 0, byteCount);
}
catch(Exception e)
{
throw new Pop3ReceiveException(e.ToString());
}

return line;
}

private void LoginToInbox()
{
string returned;

// send username ...
Send("user "+m_credential.User);

// get response ...
returned = GetPop3String();

if( !returned.Substring(0,3).Equals("+OK") )
{
throw new Pop3LoginException("login not excepted");
}

// send password ...
Send("pass "+m_credential.Pass);

// get response ...
returned = GetPop3String();

if( !returned.Substring(0,3).Equals("+OK") )
{
throw new
Pop3LoginException("login/password not accepted");
}
}


public void CloseConnection()
{
Send("quit");

m_socket = null;
m_pop3Message = null;
}

public void OpenInbox()
{
// get a socket ...
m_socket = GetClientSocket();

// get initial header from POP3 server ...
string header = GetPop3String();

if( !header.Substring(0,3).Equals("+OK") )
{
throw new Exception("Invalid initial POP3 response");
}

// send login details ...
LoginToInbox();
}
}
}

Login to the POP server just before you try to send the email.. 

p = new Pop3Client("user","password","server");
if(p != null)
{
p.OpenInbox();
// ...Send Email.
}

Monday, November 10, 2008

DeployLX - Software Protection System

Dot .Net Dilemmas

The company that I work for are looking into completely overhauling our Licensing and Software protection system for all our software products. We currently have 4-5 products that are sold over the web and installed on the clients' machine and each needs to be protected.

Our current 'in-house' system ties the license to a machine profile and this makes it difficult to manage the licenses. In the future, we need our license system to be a lot more flexible allowing for; extensions on trial versions of our software, subscriptions for both our single and floating licenses and ease of license transfer.

I was given the task of investigating the various licensing system out there and come back with a recommendation. The basic brief was;

Single License:
  • Tied to a machine profile.
  • Must be easily deactivated from one machine and transferred to another.
Floating License:
  • A company should be able to install our software on each PC/Laptops required, without having to go through a complicated registering/activation process. The Activation of the software licences should only happen on the server which controls the licences and use of software. 
  • The monitoring software should ensure that it can only be installed on one server even if that server is part of a server farm.
Trial License
  • The software can be evaluated for a predetermined amount of time. 
  • An extension may be give on the trial of the software by the use of an extension code
Subscription License
  • On both the Single and Floating licenses.

In the end, after looking at 8-10 products, I put my money (well, my company's money) on DeployLX and Codeveil from Xheo. It seemed to offer everything that we needed and compared to a lot of companies, it was pretty well priced.

Even though the support from Xheo was excellent (Gary would respond to my emails in a matter of hours and this while I was still only trialling the software). I found that the level of documentation, particularly with regards to 'How-To' style documentation to be lacking. 

There is little-or-no help of any kind on the web so I've decided to document, over the next few weeks, how to achieve the results that I need to achieve and hopefully they will be of help to others. 

Hopefully, it will also be a way of me getting out of doing too much internal documentation as I will just be able to point future employees who have to work with DeployLX to my blog.

Monday, November 3, 2008

Don't you just love when something is simple?

Dot .Net Dilemmas.

Recently I had to change my hosting provider (more about that later) and one of the issues that it caused was with a web application that was created for an Irish business.

The dates that were displayed and used in various searches needed to be in the format "dd/MM/yyyy" but because my new provider was based in the US, the hosting server reports in Pacific time. All of my code fell over and the searches produced the "String was not recognized as a valid DateTime." error.

I honestly felt that I was going to have to change a lot of code and set the CultureInfo but then I posted the question on Stackoverflow and the answer was oh so simple.

In your web.config file add the element under the node (if you don't already have one) and add the correct culture. In our case "en-gb".

<system.web>
<globalization culture="en-gb">
<!-- ... -->
</system.web>

Monday, September 22, 2008

Port 443 - Configure your firewall

Dot .Net Dilemmas
We were having some issues recently where a client could not register our software.
We got an email from them asking if we "used any any ports other than Port 80 or 8080 during the registration process?"
It turned out that they were behind a firewall where all ports were 'locked down' unless the firewall was specifically configured to allow them access. This meant that their firewall was blocking access to one of our web services but they weren't sure why. They had configured it to enable access to Port 80 and Port 8080 and assumed that this was all that they needed to do.

As part of our registration we use Port 443 for HTTPS calls (note the 'S' at the end.) Using a HTTPS URL indicated that HTTP is to be used but with a different default TCP Port - Port 443. Port 443 an additional encryption/authentication layer between the HTTP and TCP and is widely used for security-sensitive communication such as payment transactions and corporate information systems. Port 80 is typically used for unsecured HTTP calls. They configured their firewall to enable communication through Port 443 and so far so good, all registrations have gone through.

You can check the Ports used by opening IIS and clicking on 'Web Sites'. The Ports will be displayed against your various web sites in the right hand pane.

Wednesday, September 17, 2008

How do you show "<" and ">" on your blog page?

Dot .Net Dilemmas
In yesterday's blog I was trying to show an entry in a web.config file and I couldn't get the "<" to be displayed correctly so, my output was displayed as:
compilation defaultlanguage="c#" debug="false"

when of course I wanted to display it as:
<compilation defaultlanguage="c#" debug="false">

Turns out to be very simple (once you know how)
&lt; = <
&gt; = >

So
&lt;compilation defaultlanguage="c#" debug="false"&gt;
Would display as
<compilation defaultlanguage="c#" debug="false">
That's it.

Another you might need to use is:
&quot; = "

And while I'm at it, if you want to actually display &lt; and not < etc. on your blog:
Use &amp; before the &lt;

Tuesday, September 16, 2008

Making HTTP 'appear' more reliable.

Dot .Net Dilemmas
I was listening to the .NET Rocks episode 'Udi Dahan Scales Web Applications!' (date 12/08/2008) and about 1/3 of the way through it they discuss something that is, what I consider, very important and seldom discussed issue regarding making HTTP 'appear' more reliable and give our users a better and more confidence building experience while using our web sites or services.
(Some of what is written below is from notes that I have taken while listening to the .NET episode so I am not claiming this to be an original idea.)

Something that I have always struggled with is, what to do when I am on a web site purchasing something and I go to make a payment by clicking the ‘Submit’ button and hey-presto; nothing happens?
I think that it has been drilled into us over the years NOT to hit that submit button again as it could mean multiple payments on our credit card. If you are like me, you simply click the little ‘X’ button at the top of the page or browser and keep an eye on your card transactions over the next month. So, how do we stop this happening when we are designing our own sites where we want to instill some customer confidence and not lose customer business?

I came across what at the early stages sounds like a pretty good and clean solution to this problem but as yet, I have not tried to implement it.

Basically HTTP is inherently unreliable and there is not much in the broader sense of the internet that we can do about this. However, there are a number of steps we can take to lessen the impact of this shortcoming.
Basically we design a retry protocol in such a way that if we send a request from the browser to the server we don’t get a satisfactory response back from the server in a reasonable time (for any action on data where we need to ensure it remains consistent), we resend the request again.
We would also need to ensure that server side code is designed in such away that, even is the request is sent any number of times, it is only processed once. One way we could do this is to tag a GUID (Globally Unique IDentifier ) onto the request. The same GUID would be also tagged onto the response and in this way, it wouldn’t matter if the first request got lost or the first response got lost we can be pretty sure that the data that was sent was received and processed. From the user’s perspective they don't see any of this as it is all under the hood. Until that point where we say ‘yeah, we got your data’, we can ensure that our service is fairly reliable on top of an fairly unreliable protocol (HTTP).

As I’m sure you can see, this sounds a very promising solution to what is, from what I can see, a pretty universal problem for any web site that has to ensure data persistence. I am going to try and implement this on some of the web applications that I use to take customer payments over and I will update my blog on how I got on and problems that I had to overcome but for now, as I am off to Uluru for the weekend, I’ll simply post this as a reminder.

Unable to start debugging... - Part 2.

Dot .Net Dilemmas
Ok, I just got over the hump of trying to run a project developed in VS2003 with .NET 1.1 in VS2008 with .NET 2.0 or 3.0 when I get the 'Unable to start debugging on the web server' message AGAIN but with a different twist.

"Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information."

One thing that you can check first is that you have debug enabled in your web.config file. I know that this sounds obvious but it has caught me and others out on more than one occasion.

Step 1: Open the web.config
Step 2: If debug is set to "false" change it to "true".

Example:
In the web.config there will be a line similar:
<compilation defaultlanguage="c#" debug="false">

Change this to:
<compilation defaultlanguage="c#" debug="true">

(Don't forget to set this back to 'false' before you promote the code to production)

If this doesn't work, as the message says, It usually means that the web server is not configured correctly but, have you ever looked at the list that Microsoft recommend that you check to try and get it working?
I have spent hours and hours trying to implement all these 'checks' and it still didn't work. All I want to be able to do is debug the application so that I can finish me work. So, one of the great things about VS since 2005 is the ability to use the Visual Studio Development Server to run and debug your web based .NET work without the need for IIS.

The steps:
1. Right click on your project in VS2005/2008.
2. Click on Properties
3. Click on Web tab
4. Under Servers, click on the radio button Use Visual Studio Development Server
5. Check Auto Assign Port radio button
6. Uncheck NTLM Authentication and Enable Edit and Continue

Friday, September 12, 2008

Unable to Start Debugging on the Web Server.

Dot .Net Dilemmas.
"Unable to start debugging on the web server. Debugging failed because integrated Windows authentication is not enabled."

Two possible solutions that have worked for me in the past:

Solution 1:
Start --> Control Panel --> Programs And Features --> Turn Windows features on or off



Select
Internet Information Server --> World Wide Web Services --> Security
Check
Windows Authentication


Be warned, this can take a LONG time to complete and you may think your PC has hung but stay with it.

Solution 2:

1. Open IIS 7. Click "Default web sites"
2. Under 'IIS' Click "Authentication"

3. Ensure that “Anonymous Authentication” and “Windows Authentication” are 'Enabled'.