Sunday 14 August 2011

Connect to Host IIS from Virtual PC

When you need to test your application with IE 6.0 using a virtual PC, you would need to make this configuration so that you can access the host application from the virtual pc.

The solution is quite simple as below:
  • Download the windows xp VHD and run it using VPC
  • Setup your web application on your local IIS
  • Configure Visual Studio to run the app from IIS rather the default VS Dvelopment Server:

  • Go to the Url and make sure that it's accessible from your host e.g. http://localhost/app1
  • Start the Windows xp VPC
  • Go to the settings and select Shared Networking (NAT) so that your VPC can access the host.
  • Find the ip address of the host machine by running ipconfig from the host
  • From the VPC, access the Host IIS Application using the ip address of the host e.g.
http://192.168.1.102/App1


Important tip:
  • The VHD expires in Aug 2011. This is a workaround that you can use to change the current date of the VPC and takes less than 30m to configure and test.

Tuesday 2 August 2011

Method Caching Options

Options to cache a method result

1)
Using Postsharp as an AOP framework with this CodePlex Caching Manager:
  • hard to maintain if any bug appears
  • not very much reliable if a bug appears in the future
2)
Using SPRING.NET as an AOP framework with Custom CacheManager:
  • most neat
  • less maintainability
3)
CacheManager from Enterprise Library Caching Block and use it in each method
  • quickest to setup
  • Perhaps most stable
  • Duplicated code in every method (GET, ADD from/to cache)
4)
My own Custom lightweight CacheManager and use it in each method
  • Lightweight and perhaps highest performance
  • More work
  • Duplicated code in every method (GET, ADD from/to cache)