Wednesday, April 24, 2013

Azure


Steve Sanderson gave fabulous presentation on Single Page Applications at TechDays.  Bart Jolling shows how to publish this application to Azure.
I was able to get the Delivery Tracker demo working on Azure after a few tweaks.  I've outlined the details below.  I believe the main problem was that the database gets created on the fly in code.  The Azure version never creates a database and this may be due to the "cluster index" on primary key issue.  Azure SQL requires a "cluster index" and the Delivery Tracker doesn't create one.
Issues to overcome:
  • System.Net.Http version problem on my development system
  • Get code working locally on the development system
  • Preparation on Azure - create empty web site with database
  • Change the Firewall settings on Azure to allow MMSM access
  • Database is created in code, which did not work on Azure
  • Connect to the Azure database in MMSM using server name and user account
  • Export database from development to Azure will fail with Cluster Index error
  • Primary Key needs a Cluster Index for Azure using MMSM script
  • Download the proper publishing profile after all this is done
  • Use "Publish to Azure"  in Visual Studio and load Azure profile

Friday, April 5, 2013

Working with Microsoft WCF


In working with the Microsoft .NET WCF Services it does require a bit of a learning curve, along with trial and error.  Here are some of my notes on the topic:
  • I found it works best to create my WCF Service stand-alone with a new WCF Service Library.  That way I could use the WcfSvcHost from F5 to unit test the Service before including it on my SilverLight application.
  • I open the IIS manager and select the top level web site, then perform a right click "open" to locate the proper place to insert the clientaccessproxy.xml (which I test with a wide open version)
  • I used the WCF Configuration Editor instead of editing the XML by hand.  However, for some reason the WCF Editor doesn't always appear in the right click context menu for the *.config file.  In those cases, I had to actually go to the "tools" menu and specifically select the WCF Editor, then simply close it.  Afterwards, it appears in the context menu (weird).
  • I had to always remember to update the "Web Service Reference" frequently, as changes to the WCF Service aren't reflected in the Reference.vb/Reference.cs file until an update is performed.
  • DNRTV.com has wonderful videos to help you learn the tricks and techniques for .NET development, including WCF and SilverLight.
  • I would run the debugger from both the client side in the XAML code and on the server side with the .XAP and WCF code.
  • For some reason the MIMETYPE for all the SilverLight file types need to be specified in the root web site.
  • I used the EventViewer and IIS log files quite frequently for debugging.
  • I used the commandline "aspnet_regiis" from the C:\WINDOWS\Microsoft.NET\Framework version folder to verify proper ASP.NET configuration.