Method not found: ‘Boolean MS.Internal.AssemblyHelper. IsXLinqNonIdempotentProperty’


If you are using .NET 4, and run into this exception:

Method not found: ‘Boolean MS.Internal.AssemblyHelper.IsXLinqNonIdempotentProperty’

Then it turns out that there is actually a bug in .NET 4, which seems to occur when you apply a ScaleTransform to an element that has nested templates (which is almost always the case in most LOB applications).

Turns out that the good folks at Microsoft have addressed this issue in December 2010, by releasing patch number KB2464222 which you can grab here :)

Advertisements

Demystifying WPF XML namespaces


WPF XML namespaces are those fancy little cryptic strings at the top of every WPF application that you use (generally prefixed with xmlns=”..”, meaning that they are the ‘default’ namespace [i.e. no prefix required]).

But what do they mean?

Simply put, they are ‘short cuts’ to import a whole plethora of .NET WPF assemblies and make their contents available for use in your XAML file.

The most commonly used namespace is http://schemas.microsoft.com/winfx/2006/xaml/presentation, and it imports the following .NET namespaces

  • System.Windows
  • System.Windows.Automation
  • System.Windows.Controls
  • System.Windows.Controls.Primitives
  • System.Windows.Data
  • System.Windows.Documents
  • System.Windows.Forms.Integration
  • System.Windows.Ink
  • System.Windows.Input
  • System.Windows.Media
  • System.Windows.Media.Animation
  • System.Windows.Media.Effects
  • System.Windows.Media.Imaging
  • System.Windows.Media.Media3D
  • System.Windows.Media.TextFormatting
  • System.Windows.Navigation
  • System.Windows.Shapes
  • System.Windows.Shell

As you might (or might not) know, there are other XML namespaces that you can use, each represents a particular version of WPF as follows (to date):

Note that these are all mapped to the same WPF assemblies, though they implicitly define which version of WPF you are targeting.

Also, a note about winfx vs netfx:  winfx was the original name that was used to refer to the W*F technologies (WCF,WPF,WF)… this was later ditched by Microsoft.

Where is XamlPad? How can I download it?


If any of you are like me, you may have read some book, or some blog, that refers to a seemingly obscure little utility called XamlPad.

I read that this was included with the .NET Framework 3.0 SDK… so, I searched high and low… but XamlPad continued to elude me.

Further research showed that XamlPad is no more, surprisingly (or not*) due to Microsoft having a lack of resources.

There are though a few alternatives running around in the wild:

  • XamlPadX – created by a WPF team member (Lester Lobo) and full of bells and whistles ->fetch
  • XAML Cruncher – a ClickOnce application (neat), created by Charles Petzold (haven’t heard of him? Shame on you!) ->fetch
  • Kaxaml – Robby Ingebretsen’s offering (ex WPF team member) ->fetch

* well, I say ‘or not’ here since even if Microsoft do have LOTS of developers, they are also pretty busy nowadays, so I am not surprised that a teeny tool like this would be pushed aside, considering that there are comparable maintained tools out on the market already.