XamlParse Exception instantiating Knob360

Jul 2, 2010 at 8:07 PM

Hello,

I'm getting the following XamlParse Exception when I try to instantiate a Knob360:

Exception has been thrown by the target of an invocation. ---> System.Exception: 'application/xaml+xml' ContentType is not valid.
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at Codeplex.Dashboarding.Knob360.InitializeComponent() in C:\cad\si\edata\PortalAdministrator\CodePlex Dashboard\obj\Debug\Knob360.g.cs:line 102
   at Codeplex.Dashboarding.Knob360..ctor() in C:\cad\si\edata\PortalAdministrator\CodePlex Dashboard\Knob360.xaml.cs:line 39
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
   at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)

it is erroring on line 39 of Knob360.xaml which is the following:

<Ellipse Width="106.584" Height="106.166" Canvas.Left="24.96" Canvas.Top="27.046" x:Name="_spinnerBase">
                    <Ellipse.Fill>
                        <LinearGradientBrush EndPoint="0.711,0.962" StartPoint="0.227,0.07">
                            <GradientStop x:Name="_colourRangeStart" Color="#FF100F0F" Offset="0"/>
                            <GradientStop x:Name="_colourRangeEnd" Color="#FF5E5E5E" Offset="1"/>
                        </LinearGradientBrush>
                    </Ellipse.Fill>
                </Ellipse>

Here's where I instantiate the xaml:

<codeplex:Knob360 Minimum="0" Maximum="2000" x:Name="fromCadGauge"
                                      AnimationDuration="00:00:00.7500000"/>

I initially had this code working with the delivered wpf dll. I since switched to building from source because I wanted to make the dial logarithmic instead of linear which was when I encountered this problem.

My references on Codeplex.Dashboarding are:

mscorlib,PresentationCore, PresentationFramework, System, System.Core, System.Data, System.Data.DataSetExtensions, System.Drawing, System.Net, System.Windows.Browser, System.Windows.Presentation,System.Workflow.ComponentModel, System.Xml, System.Xml, System.Xml.Linq, UIAutomationProvider,WindowsBase.

Any suggestions?

Jul 6, 2010 at 4:41 PM

Disregard this. I changed my solution to reference the Codeplex.Dashboarding.Wpf assembly and everything's fine, I was trying to reference the Codeplex.Dashboarding assembly itself.