Thursday, 10 November 2011

Parallel.ForEach operations and the CancellationToken

If you use the CancellationToken to enable cancellation during the parallel iteration of an enumerable, then you should note that each operation is given a chance to finish.  The OperationCanceledException is only thrown after all the threads have completed their unit of work.

You could monitor the cancellation token inside the units of work as well if you liked.

Windows Azure DevFabric forcing port 80 rather port 81, 82 etc

Hi there, it's useful to run a Windows Azure app in the dev fabric on port 80 sometimes.  However, you need to be absolutely sure that port 80 is not in use beforehand.
Use TCPView from sysinternals and if you find that an item appears under "local port" called "http", then the port is in use.  You cannot easily find out what process that is as it's a service, however in my case, once I'd shut down "Web Deployment Agent Service" by doing Run -> CMD -> net stop MsDepSvc   this solved the issue and Azure was able to run the web role under port 80.

Also, ensure that Skype doesn't occupy port 80 too.