I'm always after the correct download links, and it takes me sometime to make sure I have the right ones, so here they are. As I come up with more I'll keep this page updated
Microsoft .NET Framework 4.5
http://www.microsoft.com/en-us/download/details.aspx?id=30653
Microsoft .NET Framework 4 (Standalone Installer)
https://www.microsoft.com/en-gb/download/details.aspx?id=17718
MSDeploy is really good for deploying websites and syncing up websites but it can be a real pain to configure and get going intially. The MSDeploy documentation is a bit poor as well and quite often you'll get a very strange error which can be quite cryptic.
Error Code: ERROR_DESTINATION_NOT_REACHABLE
The error message isn't actually too bad in this case, it's saying either the Web Management Service isn't running OR it can't find MSDeploy. Ok so checklist for this problem:
- Web Management Service (WMSVC) is running on the target server
- Port 8172 is open (checked with Telnet for good measure)
- Can you connect to https://servername:8172/msdeploy.axd
- Is MSDeploy installed
installing the latest version ms MSDeploy did it for me.
If you are like me and you don't like people shouting, you'll be quite releaved that you can stop the Menus from Visual Studio 2012 from shouting at you by changing the Menus from Uppercase to Lowercase is as simple as adding the following key in the registry:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\General\SuppressUppercaseConversion
REG_DWORD value: 1
Here is our attempt at the XLST translator, main chunk of the work was by Darren, it's a console application that applies an xsl (i.e. circle.xsl) to some xml (i.e. number.xml) and writes out the result to a console window.
private const String _filename = "number.xml";
private const String _stylesheet = "circle.xsl";
private const String _culturename = "en";
public Program()
{
//Set the UI to the specified culture.
Thread.CurrentThread.CurrentUICulture = new CultureInfo(_culturename);
//Create the XslTransform and load the stylesheet.
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(_stylesheet);
//Load the XML data file.
XPathDocument doc = new XPathDocument(_filename);
//Create an XsltArgumentList.
XsltArgumentList xslArg = new XsltArgumentList();
//Add an object to get the resources for the specified language.
ResourceTranslator resTran = new ResourceTranslator("Resources.Resource");
xslArg.AddExtensionObject("urn:myResTran", resTran);
//Add an object to calculate the circumference of the circle.
Calculate obj = new Calculate();
xslArg.AddExtensionObject("urn:myObj", obj);
//Create an XmlTextWriter to output to the console.
XmlTextWriter writer = new XmlTextWriter(Console.Out);
//Transform the file.
xslt.Transform(doc, xslArg, writer, null);
writer.Close();
}
//Calculates the circumference of a circle given the radius.
public class Calculate
{
public static double Circumference(double radius)
{
return Math.PI * 2 * radius;
}
}
The translation is based upon our database resource translator i.e. a class that creates a resource manager based on the default/neutral resource resx, and implements a Find method. This method takes a string that we want to find (specified in the default language i.e. in our case English) which is then effectively used as a key into the resource file(s). The text that is passed into the Find method is first converted into a valid identifier (e.g. spaces removed, slashes removed etc... etc...), before it can be used as a key. Then, if a key exists for the specified culture (French in the case of the test solution) then the appropriate language version of the original passed in text is returned.
In order to use the resource translator in the xsl, an object of this type is first created and then passed into the xsl using extension objects. The Find method can then be called by referencing the correct extension object, and specifying the piece of text that we would like to be translated.
public string Find(string displayText)
{
if (displayText == null) return null;
var assem = System.Reflection.Assembly.Load("Resources");
var rman = new ResourceManager(_baseName, assem);
var s = rman.GetString(Regex.Replace(displayText, "[^\\w]", string.Empty, RegexOptions.CultureInvariant));
return s jQuery15201710984220262617_1352536393022 displayText;
}
XslResourceTranslator.zip (90.45 kb)
Source can be found on GitHub https://github.com/BryanAvery/XslResourceTranslator
If you are like me, some customer just can't upgrade from SQL 2000, so how do you use the EntityFramework 4.0+ with SQL Server 2000?
Here is one solution that has worked for me:
Here are the steps to add a new Entity Framework 4.0+ entity context to a Visual Studio 2010 project:
- Download the base entity data model for SQL Server 2000 file and save it to the project folder to which you wish to add the SQL 2000 entity context. Do NOT add it to your project yet.
- Rename the EDMX file to the name of the data context.
- Open the EDMX file in a text editor.
- Find/replace all references to %DB_NAME% with your own value.
- Add this new connection string section to your App or Web.config and find/replace with your own values:
<connectionStrings>
<add name="%DB_NAME%Entities" connectionString="metadata=res://*/%DB_NAME%.csdl|res://*/%DB_NAME%.ssdl|res://*/%DB_NAME%.msl;provider=System.Data.SqlClient;provider connection string="Data Source=%DB_HOST_NAME%;Initial Catalog=%DB_NAME%;Persist Security Info=True;User ID=%DB_USER%;Password=%DB_USER_PWD%;MultipleActiveResultSets=False"" providerName="System.Data.EntityClient" />
</connectionStrings>
Please note: the connection string name MUST MATCH the EntityContainer section name you specified in the EDMX file.
- Find/replace all references to %DB_NAME% in the App or Web.config file with your own value as above.
- After the .edmx and web.config files configured, add them to the project and verify the new entity data source appears after refreshing the Data Source manager window.
- If you can't double click on your *.edmx file you'll need to right click on it and select "Open with", and choose "ADO.NET Entity Data Model Designer"
- If the new entity data source appears, open the .edmx file in design view and refresh the design model.
Now you have your Entity XML file next you can generate your Code by using the T4 templete code generation. To do this just right click in the EDMX model and select "Add Code Generation Item" this will give you the installed Generators (you can get more from NUGET, like dbcontext"
I've found this very useful and gives you a head start on old databases.
So you've upgraded to iOS 6 and keen to tryout all the new features one of them being the Passbook, time to get rid of all those printed tickets and even start thinking of replacing that old leather wallet.
So you click on the Passbook
Then you tap the App Store button to see what apps that are supported with Passbook.

If you are like me you'll get "Can't connect to iTunes Store" error 
But wayhay I found the old solution of setting the date forward manually cure this issue. It takes a few easy steps to manually change the date.
- Open Settings
- Open General
- Open Date & Time
- Turn off Automatically setting to Off
- Open Set Date & Time
- set the date to one year ahead
Now try out the Passbook and you'll be able to connect to the Apps Store, if you are like me you'll be disappointed as only two apps are currently available United Airlines and Lufthansa, none of which I use or have any intention of using.
Oh don't forget to reset your Date to Automatic
I've been playing with SQL Server Broker services to allow me to notify my C# code when some data has been changed, but first you need to enable SSB (SQL Server Broker). The easiest way of doing this is to us the following SQL statement:
alter database [<dbname>] set enable_broker with rollback immediate;
The reason for using rollback immediate is that the statement needs to have exclusive access to the database, and any connection has a shared lock on it, even when idle.
I've been a strong advocator of MEF for some time now, and with some of my work is now based around MS Workflow I thought it would be a good time to get MEF working with MS Workflow.
Before we start we need to know a few things:
- MS Workflow does not have a normals constructor
- When will we import our objects
Two simple tasks for any normal project, but MS Workflow is different, as we all know.
So to start with to deal with te fact that MS Workflow does not have any constructors we can use Extensions, as these are fired up when MS Workflow is started up. To do this it is simpley a task to add the extension in to the web.config file under <extensions> tag
<extensions>
<behaviorExtensions>
<add name="mefProviderExtension" type="MEFExtension.WorkflowServiceBehaviorElement, MEFExtension"/>
</behaviorExtensions>
</extensions>
The code by default picks up the Exported MEF objects from the BIN folder and a bin/PlugIns folder, however you can have a test in bin/tests folder, to do this you can add to behavioura mefProviderExtension
<mefProviderExtension useTestServices="true"/>
Then with every CodeActivity use the MEF method of SatisfyImportOnce to inject the MEF objects.
context.GetExtension<MefWorkflowProvider>().Container.SatisfyImportsOnce(this);
I have taken the code written by Gareth Berlow from CodePlex called MEF and Workflow Services Integration and adapted the code to make it easier to use, simply but moving all the MEF code in to a MEFExtension but still allowing the ability to generate your own overrides of the MEF object if required.
MSWorkflow _MEF.zip (66.04 kb)
I wanted to have a play with jQuery AutoComplete, so like many people I found the source and created a HTML page locally on my machine. Then you test it out, save it, uploaded it, or email it to where you need it.
Well no more jsFiddle is a playground for such trivial tasks, you can build HTML, CSS and JavaScript all online. It even allows you to choose a Framework (such a jQuery) and different versions.
So this was my first attempt at using the jQuery AutoComplete
http://jsfiddle.net/VwcV3/1/