March 2009 - Posts
Then you should check Mike Swanson’s blog post here. He has two batch files, the first downloads all MIX session recordings with in the format you like, the second renames them so it is easier to make sense of all the media file names.
If you just want a list of all sessions with download links this page might be the thing for you.
So much better than downloading them by hand. Not as good as going to the MIX itself but if you, like me, couldn’t go it is still a nice way to see all the content.
Enjoy!
Nog een paar dagen en de volgende Software Development Event is weer een feit. Er zijn weer veel goede sessies deze keer. Maar er is meer, deze keer hebben we ook een Microsoft Surface machine staan. Dus als je nog nooit de gelegenheid gehad hebt om eens met een Microsoft Surface machine te spelen en te kijken wat je er nu eigenlijk mee kan is dit je kans.
Het hele programma is hier te vinden.
Tot volgende week maandag.
The P&P team have just release a VB version of the Prism quick starts.
You can download the goods here.
Enjoy!
In a previous blog post I mentioned that T4 templates didn’t quite work with Silverlight development. The reason being that Visual Studio decides to load the Silverlight version of System.dll which doesn’t contain all the required classes. Fortunately I was not the first person to run into this limitation, Jason Jarrett did as well and he described the solution in a blog post here.
The solution turns out to be surprisingly simple, just not very obvious. All you need to do is include the following line at the top of the T4 template.
1: <#@ assembly name="C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll" #>
This way the T4 template engine loads the regular System.dll instead of the CoreCLR version and all is well.
So now the complete template looks like:
1: <#@ Template language="C#" #>
2: <#@ assembly name="C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll" #>
3: <#@ import namespace="System.Collections.Generic" #>
4: <#
5: Dictionary<string, string> props = new Dictionary<string, string>();
6: props.Add("FirstName", "string");
7: props.Add("LastName", "string");
8: props.Add("Age", "int");
9: #>
10: namespace T4Test
11: {
12: public class Demo
13: {
14: <#
15:
16: foreach (KeyValuePair<string, string> prop in props)
17: {
18: #>
19: /// <summary>
20: /// Get or set the <#= prop.Key #> property.
21: /// </summary>
22: public <#= prop.Value #> <#= prop.Key #> { get; set; }
23:
24: <#
25: }
26: #>
27: }
28: }
and the generated output looks like:
1: namespace T4Test
2: {
3: public class Demo
4: {
5: /// <summary>
6: /// Get or set the FirstName property.
7: /// </summary>
8: public string FirstName { get; set; }
9:
10: /// <summary>
11: /// Get or set the LastName property.
12: /// </summary>
13: public string LastName { get; set; }
14:
15: /// <summary>
16: /// Get or set the Age property.
17: /// </summary>
18: public int Age { get; set; }
19:
20: }
21: }
Pretty nice, something I will be using a lot more often when developing all those repetitive DTO classes.
A T4 template editor
By default Visual Studio allows you to create T4 templates by renaming a text files extension from TXT to TT but that is about it. No IntelliSense, no keyword highlighting or any of the other things we are used to.
Fortunately Clarius has developed a T4 editor that plug into Visual Studio and makes live a bit easier when developing T4 templates. There are several editions and they even have a free community edition, which I am using now. The free edition might not have all the features of the professional edition that ships for just $ 99.99 but its a big improvement over the default Visual Studio experience and for a price that is hard to beat. Below is a screen shot of the Clarius T4 editor with the same template.
Very useful and a great addition to my Visual Studio toolkit!
Enjoy!
Just one week to go to the next Software Development Event. The schedule with all the sessions is looking good. But this time there is even more!
We will have a Microsoft Surface machine somewhere in the common area for people to try our. And if you have never played, oops tested, with a Surface machine before this is a truly exiting machine!
Just goes to show, the SDN will go to extraordinary efforts to please all attendees
You can see the full schedule here. And don’t forget, we are not in Ede this time but in a great new location in Driebergen.
Hope to see everyone there next week Monday.
www.TheProblemSolver.nl
Wiki.WindowsWorkflowFoundation.eu
And now on Twitter at http://twitter.com/mauricedb.
Everyone who has Visual Studio 2008 also has T4 templates that can be used to generate code, or anything else textual for that matter. Using T4 should be pretty easy but unfortunately Visual Studio kind of hides the fact, there is no “Add T4 template” option and when you manually add one there is no help whatsoever in the box to create a working template. There are some tools out there that will help some but getting started with a simple template is easy. The following is a simple template to create a simple class
1: <#@ Template language="C#" #>
2: <#@ import namespace="System.Collections.Generic" #>
3: <#
4: Dictionary<string, string> props = new Dictionary<string, string>();
5: props.Add("FirstName", "string");
6: props.Add("LastName", "string");
7: props.Add("Age", "int");
8: #>
9: namespace T4Test
10: {
11: public class Demo
12: {
13: <#
14: foreach (KeyValuePair<string, string> prop in props)
15: {
16: #>
17:
18: /// <summary>
19: /// Get or set the <#= prop.Key #> property.
20: /// </summary>
21: public <#= prop.Value #> <#= prop.Key #> { get; set; }
22: <#
23: }
24: #>
25: }
26: }
The template looks nice, specially with the keyword highlighting but unfortunately that is my code snippet for Live Writer at work because Visual Studio only shows this as a single color text. The result is a nice C# class that looks like this:
1: namespace T4Test
2: {
3: public class Demo
4: {
5:
6: /// <summary>
7: /// Get or set the FirstName property.
8: /// </summary>
9: public string FirstName { get; set; }
10:
11: /// <summary>
12: /// Get or set the LastName property.
13: /// </summary>
14: public string LastName { get; set; }
15:
16: /// <summary>
17: /// Get or set the Age property.
18: /// </summary>
19: public int Age { get; set; }
20: }
21: }
Pretty easy to do and a useful technique don’t you think so?
The bad news
So that was rather easy and great for generating business entities with a bunch of properties, all with identical property implementations. And that is exactly what I tend to do in my Silverlight line of business applications. So I decided to try using T4 with a Silverlight project. But unfortunately that didn’t quite work. using exactly the same template I only had the single word “ErrorGeneratingOutput” appear in the output.
The errors where a bit more useful thought.
Error 1 Compiling transformation: The type or namespace name 'CompilerError' does not exist in the namespace 'System.CodeDom.Compiler' (are you missing an assembly reference?)
Error 2 Compiling transformation: The type 'System.CodeDom.Compiler.CompilerErrorCollection' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
It turns out Visual Studio uses the project references itself to run the template. And While the System.CodeDom.Compiler namespace exists in Silverlight the required classes like CompilerError and CompilerErrorCollection do not.
This really is a shame as there is really no good reason that T4 templates do not work for Silverlight. All generation is done in Visual Studio, which has access to the full .NET framework, and not at runtime in the browser.
Still enjoy T4 in the full framework.
www.TheProblemSolver.nl
[2]
And now on Twitter at http://www.twitter.com/mauricedb.
Attached are the PowerPoint presentation and samples from my WF with WCF presentation in Timisoara, Romania. Thanks to Ineta for providing the funding for this.
Attached are the PowerPoint presentation and samples from my state machine workflow presentation in Timisoara, Romania. Thanks to Ineta for providing the funding for this.
Attached is are the samples and slides I used for my intro into WCF talk yesterday at the VB Central meeting in the Netherlands.
Enjoy!
www.TheProblemSolver.nl
Wiki.WindowsWorkflowFoundation.eu
Now also on twitter at http://twitter.com/mauricedb
Last year Marcel and I worked on a problem using a TransactionScopeActivity inside a WCF ReceiveActivity. I blogged a number of time about our finding, for example here.
Last week I heard from Marcel that a hotfix was finally available that solves this problem. He blogged about it here. Great work to see there is a fix for this serious problem.
Enjoy!
www.TheProblemSolver.nl
Wiki.WindowsWorkflowFoundation.eu
And now on Twitter at http://twitter.com/mauricedb.
Day three of the MVP summit is about to begin here in Seattle so we are past the half way mark. Yesterday was an interesting day with lots of good, and some bad, sessions. While I can’t go into specifics the future of Silverlight looks bright
which makes me happy. Today I will be attending some more Silverlight sessions and really looking forward to it.
Some of the other sessions I went to where not quite as good though. Some of the product decisions I heard are, how shall I put this, less than perfect. Unfortunately I can’t go into details but rest assured I will as soon as I can.
So today is another day at the Microsoft campus. These are always the best days as we get to talk to the product groups and the people actually building all the software and tools we use. Looking forward to it!
www.TheProblemSolver.nl
Wiki.WindowsWorkflowFoundation.eu
Last week lots of MVP, myself included, where in Redmond visiting Microsoft on our yearly MVP pilgrimage. The MVP Summit is always a great event. Not only do we get to talk to the MS team members who actually design and build all the software we love and use but we also get to meet each other. And with MVP’s being located around the world that is kind of rare as well.
Despite this being a great event I still have very mixed feelings about this last MVP summit. The problem isn’t the events itself or the people I met, that was al great
. No the problem was in some of the technological decisions made in product groups. Unfortunately I can’t divulge details yet because I have signed an NDA but as soon .NET 4.0 as beta 1 is made public I will be able to blog about some of these decisions. And rest assured I will!
The reason we really need to is the way these important changes are communicated. Or should I say not communicated. Some very important changes where not communicated at all and could only be derived by bullet points missing from PowerPoint slides. Only when directly asked about the missing bullet point would someone say “Yes that is right, we decided to …. NDA … because … NDA …”. Sorry about the NDA part
.
I can only say that these decisions are a big problem and I know several MVP’s who decided to skip other sessions on the same product as a result. I didn’t, as far as I am concerned ignoring a problem is not going to make it go away, but I really think this product team needs to reevaluate this decision and the general future trend.
Despite this hiccup I am very exited about lots of the things I got to see and am really looking forward to .NET 4 and Visual Studio 2010. Now if we only could have a beta today
. When we will have a first beta is still a big question though. If a date was announced I missed it, the best I heard was a quarter and is quite a time span.
Enjoy.
www.TheProblemSolver.nl
Wiki.WindowsWorkflowFoundation.eu
Next week, on march 10th, I will be doing a presentation on getting started with WCF at the VB Central user group in the Netherlands. Its a free event so if you are in the neighborhood feel free to drop by. They do ask you register beforehand. Besides my session on WCF there will also be a session on using WPF and data binding.
Mode details and the registration page can be found here.
Hope to see you there.
www.TheProblemSolver.nl
Wiki.WindowsWorkflowFoundation.eu