To test this, I created a new project (WPF application) in VS2008. The application built and ran without me making any modifications to it. Then, I added the references listed above and attempted to run it again. The application runs, but at design time the main window Window1.xaml is not displayed. Instead, I get the following exception information:
Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType) at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at Microsoft.Windows.Design.Features.FeatureManager.FeatureConnectorEntry.AttemptActivate() at Microsoft.Windows.Design.Features.FeatureManager.FeatureConnectorEntry.OnRequirementsChanged(Object sender, EventArgs e) at Microsoft.Windows.Design.RequirementValidator.OnRequirementChanged(Object sender, EventArgs e) at Microsoft.Windows.Design.RequirementSubscription.OnRequirementChanged() at Microsoft.Windows.Design.RequiresContextItemAttribute.RequireContextItemSubscription.OnContextItemChanged(ContextItem item) at Microsoft.Windows.Design.SubscribeContextCallback.Invoke(ContextItem item) at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.OnItemChanged(ContextItem item) at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.SetValue(ContextItem value) at Microsoft.Windows.Design.Interaction.DesignerView.set_Context(EditingContext value) at MS.Internal.Designer.SimpleViewManager.get_View() at Microsoft.Windows.Design.Documents.MarkupDocumentManager.get_View() at MS.Internal.Host.PersistenceSubsystem.get_DocumentView() at MS.Internal.Host.Designer.get_View() at MS.Internal.Designer.VSDesigner.Load() at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load() at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.Load() at MS.Internal.Designer.DesignerPane.LoadDesignerView()
Unable to cast object of type 'MS.Internal.NamedObject' to type 'System.Windows.Input.Cursor'.
at MS.Internal.Interaction.DesignerResources.GetCursor(ResourceKey key) at MS.Internal.GridControl.GridPanelAdorner..ctor(Grid grid) at MS.Internal.GridControl.GridDesigner..ctor(ModelItem gridItem) at MS.Internal.GridControl.GridDesigner.GetDesigner(ModelItem gridItem) at MS.Internal.GridControl.AlwaysVisibleGridAdornersProvider.Activate(ModelItem item, DependencyObject view) at Microsoft.Windows.Design.Interaction.AdornerProvider.InvokeActivate(EditingContext context, ModelItem item, DependencyObject view) at MS.Internal.Features.AdornerProviderFeatureConnector.FeatureProvidersAdded(ModelItem item, IEnumerable`1 extensions) at Microsoft.Windows.Design.Features.PolicyDrivenFeatureConnector`1.UpdateFeatureProviders() at MS.Internal.Features.PolicyDrivenToolFeatureConnector`1.UpdateCurrentTool(Tool newTool) at MS.Internal.Features.PolicyDrivenToolFeatureConnector`1.<.ctor>b__0(Tool newTool) at Microsoft.Windows.Design.ContextItemManager.SubscribeProxy`1.SubscribeContext(ContextItem item) at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.Subscribe(Type contextItemType, SubscribeContextCallback callback) at Microsoft.Windows.Design.ContextItemManager.Subscribe[ContextItemType](SubscribeContextCallback`1 callback) at MS.Internal.Features.PolicyDrivenToolFeatureConnector`1..ctor(FeatureManager manager) at MS.Internal.Features.AdornerProviderFeatureConnector..ctor(FeatureManager manager)
Again, I did NOTHING to this project except add the references to it. Removing the references causes the exception to disappear and the window is displayed at design time as expected.
This exception is a little different from the exception I get in my other application, which contains two nested RadTabControls. Here is that exception:
System.Windows.Markup.XamlParseException occurred
Message="'/Telerik.Windows.Controls.Navigation;component/Themes/GenericVista.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. '/Telerik.Windows.Controls.Navigation;component/themes/vista/CarouselDataFieldPresenter.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Object reference not set to an instance of an object. Error at object 'System.Windows.ResourceDictionary' in markup file 'Telerik.Windows.Controls.Navigation;component/Themes/GenericVista.xaml'. Error at object 'System.Windows.ResourceDictionary'."
Source="PresentationFramework"
LineNumber=0
LinePosition=0
NameContext="MergedDictionaries"
StackTrace:
at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException)
at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)
at System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord)
at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
at System.Windows.Markup.TreeBuilder.Parse()
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.SystemResources.ResourceDictionaries.LoadDictionary(Assembly assembly, String assemblyName, String resourceName, Boolean isTraceEnabled)
at System.Windows.SystemResources.ResourceDictionaries.LoadGenericDictionary(Boolean isTraceEnabled)
at System.Windows.SystemResources.FindDictionaryResource(Object key, Type typeKey, ResourceKey resourceKey, Boolean isTraceEnabled, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean& canCache)
at System.Windows.SystemResources.FindResourceInternal(Object key, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference)
at System.Windows.StyleHelper.GetThemeStyle(FrameworkElement fe, FrameworkContentElement fce)
at System.Windows.FrameworkElement.UpdateThemeStyleProperty()
at System.Windows.FrameworkElement.OnThemeStyleKeyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at System.Windows.FrameworkElement.set_DefaultStyleKey(Object value)
at Telerik.Windows.Controls.RadTabControl.SetDefaultStyleKey()
at Telerik.Windows.Controls.RadTabControl.ResetTheme()
at Telerik.Windows.Controls.StyleManager.OnThemeChanged(DependencyObject target, DependencyPropertyChangedEventArgs changedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at System.Windows.Markup.BamlRecordReader.SetDependencyValueCore(DependencyObject dependencyObject, DependencyProperty dependencyProperty, Object value)
at System.Windows.Markup.BamlRecordReader.SetDependencyValue(DependencyObject dependencyObject, DependencyProperty dependencyProperty, Object value)
at System.Windows.Markup.BamlRecordReader.SetPropertyValue(Object o, PropertyDefinition propertyDefinition, Object value)
at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)
at System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord)
at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
at System.Windows.Markup.TreeBuilder.Parse()
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at Fluke.Utilities.ProductConfig.ProductionAssistant.InitializeComponent() in t:\VS2008\ProductionAssistant\ProductionAssistant\ProductionAssistant.xaml:line 1
at Fluke.Utilities.ProductConfig.ProductionAssistant..ctor() in T:\VS2008\ProductionAssistant\ProductionAssistant\ProductionAssistant.xaml.cs:line 16
InnerException: System.Windows.Markup.XamlParseException
Message="'/Telerik.Windows.Controls.Navigation;component/themes/vista/CarouselDataFieldPresenter.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Object reference not set to an instance of an object. Error at object 'System.Windows.ResourceDictionary' in markup file 'Telerik.Windows.Controls.Navigation;component/Themes/GenericVista.xaml'."
Source="PresentationFramework"
LineNumber=0
LinePosition=0
NameContext="MergedDictionaries"
StackTrace:
at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException)
at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)
at System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord)
at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
at System.Windows.Markup.TreeBuilder.Parse()
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverter(Stream stream, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter)
at MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStream(Stream s, ContentType contentType, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter)
at System.Windows.ResourceDictionary.set_Source(Uri value)
InnerException: System.NullReferenceException
Message="Object reference not set to an instance of an object."
Source="PresentationFramework"
StackTrace:
at System.Windows.Markup.XmlnsCache.GetClrnsToAssemblyNameMappingList(Assembly[] asmList, String xmlnsRequested)
at System.Windows.Markup.XmlnsCache.GetMappingArray(String xmlns)
at System.Windows.Markup.XamlTypeMapper.GetClrNamespacePairFromCache(String namespaceUri)
at System.Windows.Markup.XamlTypeMapper.GetNamespaceMapEntries(String xmlNamespace)
at System.Windows.Markup.XamlTypeMapper.CreateTypeAndSerializer(String xmlNamespace, String localName)
at System.Windows.Markup.XamlTypeMapper.GetTypeOnly(String xmlNamespace, String localName)
at System.Windows.Markup.XamlTypeMapper.GetType(String xmlNamespace, String localName)
at System.Windows.Markup.XamlTypeMapper.GetTypeFromBaseString(String typeString, ParserContext context, Boolean throwOnError)
at System.Windows.Markup.ProvideValueServiceProvider.System.Windows.Markup.IXamlTypeResolver.Resolve(String qualifiedTypeName)
at System.Windows.Markup.TypeTypeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
at System.ComponentModel.TypeConverter.ConvertFromString(ITypeDescriptorContext context, CultureInfo culture, String text)
at System.Windows.Markup.XamlTypeMapper.ParseProperty(Object targetObject, Type propType, String propName, Object dpOrPiOrFi, ITypeDescriptorContext typeContext, ParserContext parserContext, String value, Int16 converterTypeId)
at System.Windows.Markup.BamlRecordReader.ParseProperty(Object element, Type propertyType, String propertyName, Object dpOrPi, String attribValue, Int16 converterTypeId)
at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)
at System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord)
at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
at System.Windows.Markup.BamlRecordReader.BaseReadDeferableContentStart(BamlDeferableContentStartRecord bamlRecord, ArrayList& defKeyList, List`1& staticResourceValuesList)
at System.Windows.Markup.BamlRecordReader.ReadDeferableContentStart(BamlDeferableContentStartRecord bamlRecord)
at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
at System.Windows.Markup.TreeBuilder.Parse()
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverter(Stream stream, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter)
at MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStream(Stream s, ContentType contentType, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter)
at System.Windows.ResourceDictionary.set_Source(Uri value)
InnerException:
This application will only display the main window at design time if I remove the references I mentioned above. Even removing all of the RadTabControl XAML code does not allow the window to be displayed if the references are still included.
The only odd thing I remember seeing immediately before this started happening was a green balloon appearing on the Telerik menu in VS2008 indicating there was an upgrade available and asking if I wanted to upgrade my project. I ignored the message because I did not want to affect my project until I reached a point where I could deal with that by itself. After this exception started to occur, I tried running the upgrade to see if that would resolve the problem, but it did not. I also uninstalled ALL Telerik WPF controls from my machine and re-installed the 2010_0309_DEV version. (JustCode is also installed on my machine)
Here is my XAML code for the window that will not load in the designer:
<Window |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
x:Class="Fluke.Utilities.ProductConfig.ProductionAssistant" |
xmlns:local="clr-namespace:Fluke.Utilities.ProductConfig" |
xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase" |
Title="Production Assistant" MinWidth="640" MinHeight="600" |
Background="{DynamicResource WindowBackgroundGradient}" |
SizeToContent="WidthAndHeight" WindowStyle="ThreeDBorderWindow" > |
<Window.Resources> |
<DataTemplate x:Key="groupsHeader"> |
<StackPanel Orientation="Horizontal"> |
<Image Source="{Binding Path=Image}" Margin="3" Height="32" Width="32"/> |
<TextBlock Text="{Binding Path=Name}" Foreground="Black" Margin="3" VerticalAlignment="Center"/> |
</StackPanel> |
</DataTemplate> |
<DataTemplate x:Key="productsHeaders"> |
<StackPanel x:Name="spProductTabHeader" Orientation="Vertical"> |
<TextBlock Text="{Binding Path=BaseModel}" Margin="3" VerticalAlignment="Center"/> |
<Image Source="{Binding Path=Image}" Margin="3" Height="32" Width="32"/> |
</StackPanel> |
</DataTemplate> |
<DataTemplate x:Key="productsContent"> |
<ContentControl Content="{Binding Path=UserInterface}"/> |
</DataTemplate> |
<DataTemplate x:Key="groupsContent"> |
<StackPanel Orientation="Vertical"> |
<StackPanel Orientation="Horizontal"> |
<TextBlock Margin="10,10,2,10" FontSize="14" FontWeight="Bold" Text="Choose a"/> |
<TextBlock Margin="2,10,2,10" FontSize="14" FontWeight="Bold" Text="{Binding Path=Name}"/> |
<TextBlock Margin="2,10,10,10" FontSize="14" FontWeight="Bold" Text="product from the tabs below:"/> |
</StackPanel> |
<telerikNavigation:RadTabControl TabStripPlacement="Left" TabOrientation="Horizontal" x:Name="tabProducts" |
Margin="5" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" telerik:StyleManager.Theme="Windows7" ScrollMode="Item" |
MinHeight="250" MaxHeight="480" MinWidth="400" |
ItemsSource="{Binding Path=Products, Mode=OneTime}" |
SelectedItem="{Binding Path=SelectedProduct, Mode=TwoWay}" |
ItemTemplate="{StaticResource productsHeaders}" |
ContentTemplate="{StaticResource productsContent}"> |
</telerikNavigation:RadTabControl> |
</StackPanel> |
</DataTemplate> |
</Window.Resources> |
<Grid x:Name="grid"> |
<Grid.RowDefinitions> |
<RowDefinition Height="Auto" /> |
<RowDefinition Height="Auto" /> |
<RowDefinition Height="Auto" /> |
<!--<RowDefinition Height="Auto" />--> |
</Grid.RowDefinitions> |
<Menu Grid.Row="0"> |
<MenuItem Header="_File"> |
<MenuItem x:Name="ExitApplication" Header="Exit"></MenuItem> |
</MenuItem> |
<MenuItem Header="_Tools"> |
<MenuItem x:Name="ImportMACAddresses" Header="Import MAC Addresses from File..."/> |
<MenuItem x:Name="ImportOrders" Header="Import Order Info from File..."/> |
<MenuItem x:Name="ImportFinalDestinations" Header="Import Final Destination Records from FoxPro..."/> |
<MenuItem x:Name="ImportProductConfigurations" Header="Import Product Configurations from Spreadsheet..."/> |
<MenuItem x:Name="ReassignSerialNumber" Header="Reassign Serial Number..."/> |
<MenuItem x:Name="ShowOptions" Header="Options"/> |
</MenuItem> |
<MenuItem Header="_Help"> |
<MenuItem x:Name="mnuAbout" Header="_About"></MenuItem> |
</MenuItem> |
</Menu> |
<StackPanel Grid.Row="1" > |
<TextBlock Margin="5" FontWeight="Bold" FontStyle="Italic" FontSize="24" Text="Production Assistant"/> |
</StackPanel> |
<telerikNavigation:RadTabControl x:Name="tabGroups" Grid.Row="2" MinHeight="250" |
Margin="5" VerticalAlignment="Stretch" |
HorizontalAlignment="Stretch" telerik:StyleManager.Theme="Windows7" ScrollMode="Item" |
SelectedItem="{Binding Path=SelectedGroup, Mode=TwoWay}" |
ItemsSource="{Binding Path=Groups}" SelectedIndex="0" |
ItemTemplate="{StaticResource groupsHeader}" |
ContentTemplate="{StaticResource groupsContent}"/> |
<!--<DockPanel Grid.Row="3" LastChildFill="True" > |
<TextBlock DockPanel.Dock="Top" Margin="2">Status:</TextBlock> |
<ListView DockPanel.Dock="Top" Name="lvStatus" Margin="2" MinHeight="50" ItemsSource="{Binding Path=Feedback, NotifyOnTargetUpdated=True}" TargetUpdated="lvStatus_TargetUpdated"/> |
</DockPanel>--> |
</Grid> |
</Window> |