Could not load file or assembly ‘NameOfAssemblyGoesHere’

Encounted the following error:

Could not load file or assembly ‘NameOfAssemblyGoesHere’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

The problem happened when deploying a web application to a 64bit server where all the required DLL’s where marked as running only on a 32bit system.   You can change this by setting the target platform to AnyCPU which will solve this issue.   There is another workaround which is setting IIS compatability mode to 32bit, Open a command prompt and navigate to the %systemdrive%\Inetpub\AdminScripts directory.  Type in the command cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 “true”.

Spot the IT Guy!

This is soo funny but soo true?

http://www.deansproperty.com.au/Home/Profiles

Change username in ASP.NET Membership Provider

Found a great article here about the process of changing the username with the ASP.NET Membership Provider.

Here is a summary of the process that I found best useful which is one of the comments:

1. Make sure New UserName is Unique

2. Update the aspnet_Users table directly

3. Execute to following code to change the username/cookie/identity without leaving the webpage…

‘ Obtains the name of the FormsAuthentication Cookie, uses that name to request the Cookie and Decrypts the Cookies information into a AuthTicket

Dim AuthTicket As FormsAuthenticationTicket = FormsAuthentication.Decrypt(HttpContext.Current.Request.Cookies(FormsAuthentication.FormsCookieName).Value)

‘ Instantiates a new user identity authenticated using forms authentication based on the FormsAuthenticationTicket.

‘ The FormsAuthenticationTicket has been created using the exact same parameters of the user with the Old Username except the Old Username has been updated with the New Username.

Dim NewFormsIdentity As New FormsIdentity(New FormsAuthenticationTicket(AuthTicket.Version, NewUsername, AuthTicket.IssueDate, AuthTicket.Expiration, AuthTicket.IsPersistent, AuthTicket.UserData))

‘ Parse out the AuthTicket’s UserData into a string array of Roles

Dim Roles As String() = AuthTicket.UserData.Split(“|”.ToCharArray)

‘ Creates a new user that has the NewFormsIdentity and belongs to the array of Roles, if any, that was stored in the FormsAuthenticationTicket

Dim NewGenericPrincipal As New System.Security.Principal.GenericPrincipal(NewFormsIdentity, Roles)

‘ Sets the security information for the current HTTP request to the new user. The Username has now been changed (i.e. HttpContext.Current.User.Identity.Name = NewUsername, prior to this step is was the OldUsername)

HttpContext.Current.User = NewGenericPrincipal

‘ Removes the forms-authentication ticket from the browser

FormsAuthentication.SignOut()

‘ Cancels the current session

HttpContext.Current.Session.Abandon()

‘ Creates an authentication ticket for the supplied New Username and adds it to the cookies collection of the response or the URL

FormsAuthentication.SetAuthCookie(HttpContext.Current.User.Identity.Name, AuthTicket.IsPersistent)

4. Response.Redirect back to the same page if needed.

References:

http://omaralzabir.com/how_to_change_user_name_in_asp_net_2_0_membership_provider/

IIS Wont start error 13 data is invalid

I got the following error when trying to figure out why I couldn’t start IIS 7 on Windows Server 2008 R2.    I tried to start the World Wide Web Publishing Service but its dependency Windows Activation Service wouldn’t start.   I got the following error in the Event Log:

The Windows Process Activation Service service terminated with the following error:
The data is invalid.

After doing some research, I found a good article here.   But I still had the issue, it turned out that I had a valid applicationHost.config file but my C:\Windows\system32\inetsrv\config\schema\NetFx40_IIS_schema_update.xml file was corrupt and had invalid XML.   So I was able to recover the XML file from the C:\inetput\history\schema folder.  Fewl!   Run all the services again and had no problems.

References:

http://www.gringod.com/2008/08/15/when-iis-wont-start-error-13/

http://www.gringod.com/2008/08/15/when-iis-wont-start-error-13/”

A way around page refreshes/back button problems with a simple concept

The problem:

You have a form in which the user fills out and clicks a “submit” button that validates their input, does some processing and output’s some results. The problem being the application needs to cater for page refreshes, back buttons and the case of the page being submitted more than once (latency/slow internet connection).

The Solution:

Possible solutions can be (this assumes not using Ajax as a solution), once the user clicks the submit button the server validates the user’s input and has processed the information. Store a unique id in session and redirect to a “complete” page. If the user clicks the back button and resubmits the page, you can build logic to check if a unique id exists in session and if it does, redirect to the complete page without having to re-process the information.

If the user is on the complete page and refreshes the page, because its on a page which has used a GET, there is no processing done and hence no duplication of data.

References:

http://en.wikipedia.org/wiki/Post/Redirect/Get

http://stackoverflow.com/questions/665399/how-do-i-stop-the-back-and-refresh-buttons-from-resubmitting-my-form

Facebook “like” button API rocks!

You can now add the “like” button on to your own webpage by using either their iframe html markup or using the new Javascript SDK which is more flexible than the iframe solution.

You can see a live example of this on http://www.medicsafe.co.nz which uses the like button on each product listed on the website.

Or you can test it out here

Just make sure that you set the height css as by default it’s not set which is annoying!

References:

http://developers.facebook.com/docs/reference/plugins/like

http://www.medicsafe.co.nz

Scrum training – what can I expect? part 2

I have completed my Certified Scrum Master course and have found that I can answer my questions in the previous post “Scrum Training – what can I expect?

  • How can scrum be applied to an organisation where they do not use develop their own software but rather develop custom solutions for their clients? – It doesn’t matter what type of software is being developed, SCRUM is a set of principles that can be applied to any type of situation, its not necessarily the easiest framework to adopt.
  • How can scrum be applied to projects where projects can be as small as 1-2days of development time to projects that can take several months? - Ideally SCRUM sprints should be between 2 – 4 weeks and the team should be dedicated to that sprint, if there are multiple projects happening at the same time, the question comes down to, should we have separate teams to deal with these separate projects? perhaps a BAU or production support team dealing with BAU work and the other teams focused on project work? It is far more efficient to have a team dedicated to a sprint, complete the sprint then move onto the next piece of work.
  • What tools are best used with scrum from a project management perspective, does Microsoft Team Foundation Server 2010 handle scrum better? - Yet to be answered, perhaps this will turn into a internal project for me to find out what TFS 2010 has to offer?
  • What can I expect when trying to change a whole team of developers who use a combination of different software development methodologies? - Hard work, resistance to change, have to be patient and determination.   SCRUM will show transparency within the organisation, be prepared to to face challenges when education team and management about SCRUM.   Fully SCRUM teams/projects within an organisation can take up to 2 years.
  • What can I expect when trying to change  an organisation who has developed their own software methodology built on years of trial and error? – From the above answer, resistance, will need buy-in from management, but most importantly that SCRUM will highlight issues that exist in the organisation and its up to the team and management to accept that there will be the need for change.

Scrum training – what can I expect?

I’m on a scrum training course tomorrow to be a Certified Scrum master.   To me though, what I want to get out of this experience is:

  • How can scrum be applied to an organisation where they do not use develop their own software but rather develop custom solutions for their clients?
  • How can scrum be applied to projects where projects can be as small as 1-2days of development time to projects that can take several months?
  • What tools are best used with scrum from a project management perspective, does Microsoft Team Foundation Server 2010 handle scrum better?
  • What can I expect when trying to change a whole team of developers who use a combination of different software development methodologies?
  • What can I expect when trying to change  an organisation who has developed their own software methodology built on years of trial and error?

To be continued…perhaps I will know the answers in a few days time!

Quotes from Clients/Project Managers

Here are some quotes that clients/project managers have asked me while working in the web development industry:

Can you do me a wee favour?

Can you do this 10 minute job for me?

I have this small problem I need you to fix

This job should only take an hour!

The website is broken

Yes, all of the functionality meets our requirements..but can we just do this instead?