Wednesday, September 11, 2013

Teach Yourself Azure in 4 Hours

Learning to use Azure:
  1. Create Web Site - Check
    https://manage.windowsazure.com/?whr=live.com#Workspaces/All/dashboard
  2. Create Database – Check
    https://manage.windowsazure.com/?whr=live.com#Workspaces/SqlAzureExtension/Databases
  3. Upload Project to TFS – Check
    http://tfs.visualstudio.com/
  4. Link TFS to Azure Web Site – Check
    http://www.windowsazure.com/en-us/develop/net/common-tasks/publishing-with-tfs/
  5. Download Azure SDK for Visual Studio 2010 – Check
    http://www.microsoft.com/en-nz/download/details.aspx?id=15658
  6. Download Web Site publication connection settings – Check
    http://www.asp.net/mvc/tutorials/deployment/cse-curated-view-deploy-to-waws
  7. Publish Web Site to Azure – Check
    (see above)
  8. Create Visual Studio VM – Check
    https://manage.windowsazure.com/?whr=live.com#Workspaces/VirtualMachineExtension/vms
  9. Synchronise Local Database Schema to Azure Database - Check.
    http://msdn.microsoft.com/en-us/library/windowsazure/ee730904.aspx
  10. Synchronise Local Database Data to Azure - Check.
    http://www.windowsazure.com/en-us/manage/services/sql-databases/getting-started-w-sql-data-sync/
Not easy, but worth it.
Got inspired by Scott Guthrie’s session on Azure yesterday at Tech Ed 2013, Auckland, NZ.

Tuesday, July 9, 2013

My First PowerShell Script

What It Does

Finds a list of Active Directory groups, based on a filter. For each one found, rename it to something else. Write back the change to Active Directory.

The Code

$theList = Get-ADGroup -Filter {sAMAccountName -like "SomeGroupPrefix*"} | Select Name, sAMAccountName, DistinguishedName

foreach ($i in $theList) {
$newName = $i.name -replace "Some", "Any"
#write-host $i.name, $newName
Rename-ADObject -Identity $i.DistinguishedName -NewName $newName
}

Wednesday, January 16, 2013

System.BadImageFormatException

Scenario:
  • I've built a .NET 4.0 Windows Forms app...
  • I've added it to a .NET 4.0 Setup project...
  • My DEV PC has .NET 4.0 Framework installed...
  • When I attempt to install the resultant .msi, I get an error message...
System.BadImageFormatException: Could not load file or assembly...This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Setup:
  • On a DEV VM
  • 32 bit
  • Windows 7
  • Visual Studio 2010.

Resolution:
  • The Setup project has a folder for Detected Dependencies...
  • In there is listed Microsoft .NET Framework...
  • When you double-click that, you get a Launch Conditions window...
  • Under Launch Conditions, is listed the .NET Framework version...
  • This was set incorrectly.