This is a migrated thread and some comments may be shown as answers.

Grid exception

11 Answers 725 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ifle
Top achievements
Rank 1
ifle asked on 16 Jul 2010, 09:50 AM
Hi,

I  have my VSPackage extention for VS2010.
I have tried to use with the GridView in my custom window pane, but  I have exception.
I referenced are following assemblies :
            Telerik.Windows.Controls
            Telerik.Windows.Controls.Data
            Telerik.Windows.Controls.Input
            Telerik.Windows.Controls.GridView
            Telerik.Windows.Data

I don't know what is missing?
I use the 2010.2 version.


"System.Windows.Markup.XamlParseException: 'Initialization of 'Telerik.Windows.Controls.GridViewCheckBoxColumn' threw an exception.' Line number '34' and line position '66'. 
---> System.Xaml.XamlObjectWriterException: Set property 'System.Windows.ResourceDictionary.Source' threw an exception. 
---> System.Windows.Markup.XamlParseException: Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception. 
---> System.Xaml.XamlObjectWriterException: Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception. 
---> System.IO.FileNotFoundException: Could not load file or assembly 'Telerik.Windows.Controls.Input, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The system cannot find the file specified.
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityC
hecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at System.Windows.Baml2006.Baml2006SchemaContext.ResolveAssembly(BamlAssembly bamlAssembly)
   at System.Windows.Baml2006.Baml2006SchemaContext.GetAssembly(Int16 assemblyId)
   at System.Windows.Baml2006.Baml2006SchemaContext.EnsureXmlnsAssembliesLoaded(String xamlNamespace)
   at System.Windows.Baml2006.Baml2006SchemaContext.GetXamlType(String xamlNamespace, String name, XamlType[] typeArguments)
   at System.Xaml.XamlSchemaContext.GetXamlType(XamlTypeName xamlT
ypeName)
   at MS.Internal.Xaml.XamlContext.GetXamlType(XamlTypeName typeName, Boolean returnUnknownTypesOnFailure, Boolean skipVisibilityCheck)
   at MS.Internal.Xaml.XamlContext.ResolveXamlType(String qName, Boolean skipVisibilityCheck)
   at MS.Internal.Xaml.Context.ObjectWriterContext.ServiceProvider_Resolve(String qName)
   at MS.Internal.Xaml.ServiceProviderContext.System.Windows.Markup.IXamlTypeResolver.Resolve(String qName)
   at System.Windows.Markup.TypeTypeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at System.Windows.Baml2006.TypeConverterMarkupExtension.ProvideValue(IServiceProvider serviceProvider)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension me, IServiceProvider serviceProvider)
   --- End of inner exception stack trace ---
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension me, IServiceProvider serviceProvider)
   at System.Xaml.XamlObjectWriter.Logic_Pro
videValue(ObjectWriterContext ctx)
   at System.Xaml.XamlObjectWriter.Logic_AssignProvidedValue(ObjectWriterContext ctx)
   at System.Xaml.XamlObjectWriter.WriteEndMember()
   at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
   at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter)
   at System.Windows.ResourceDictionary.EvaluateMarkupExtensionNodeList(XamlReader reader, IServiceProvider serviceProvider)
   at System.Windows.ResourceDictionary.GetKeyValue(KeyRecord key, IServiceProvider serviceProvider)
   at System.Windows.ResourceDictionary.SetKeys(IList`1 keyCollection, IServiceProvider serviceProvider)
   at System.Windows.ResourceDictionary.SetDeferrableContent(DeferrableContent deferrableContent)
   at System.Windows.Baml2006.WpfSharedBamlSchemaContext.<Create_BamlProperty_ResourceDictionary_DeferrableContent>b__168(Object target, Object value)
   at System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(Object instance
, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
   --- End of inner exception stack trace ---
   at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   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.AppMode
l.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)
   at System.Windows.Baml2006.WpfSharedBamlSchemaContext.<Create_BamlProperty_ResourceDictionary_Source>b__1c4(Object target, Object value)
   at System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(Object instance, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
   --- End of inner ex
ception stack trace ---
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
   at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.SetValue(Object obj, XamlMember property, Object value)
   at System.Xaml.XamlObjectWriter.SetValue(Object inst, XamlMember property, Object value)
   at System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(ObjectWriterContext ctx, XamlMember prop, Object value, Boolean onParent)
   at System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(ObjectWriterContext ctx)
   at System.Xaml.XamlObjectWriter.Logic_AssignProvidedValue(ObjectWriterContext ctx)
   at System.Xaml.XamlObjectWriter.WriteEndMember()
   at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
   at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter)
   at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter)
   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.FrameworkContentElement.UpdateThemeStyleProperty()
   at System.Windows.FrameworkContentElement.OnThemeStyleKeyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArg
s e)
   at System.Windows.FrameworkContentElement.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, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at System.Windows.FrameworkContentElement.set_DefaultStyleKey(Object value)
   at Telerik.Windows.Controls.GridViewColumn.ResetDefaultStyleKey()
   at Telerik.Windows.Controls.GridVi
ewColumn.OnInitialized(EventArgs e)
   at System.Windows.FrameworkContentElement.TryFireInitialized()
   at System.Windows.FrameworkContentElement.EndInit()
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin)
   --- End of inner exception stack trace ---
   at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadComponent(Object component, Uri r
esourceLocator)
   at DeveloperTools.PagePaneControl.InitializeComponent() 
   at DeveloperTools..UI.MainPage.PagePaneControl..ctor()

11 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 16 Jul 2010, 09:55 AM
Hello igor609,

 This is very strange since the exception message is that Telerik.Windows.Controls.Input.dll cannot be loaded. Can you verify once again if this assembly (correct version) is referenced properly? Can you try to clean and rebuild the project?

Kind regards,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
ifle
Top achievements
Rank 1
answered on 16 Jul 2010, 10:15 AM
The referenced assembly has 2010.2.714.35 version.
I've cleaned my solution but it's don't helped.

My application is extension to the VS, it's not regular WPF application.
Maybe the hosting of VS has some problem with loading are some  telerik assemblies.


P.S. Sorry for my bad english :)
0
B Jones
Top achievements
Rank 1
answered on 18 Jul 2010, 06:20 AM
        
0
Pavel Pavlov
Telerik team
answered on 19 Jul 2010, 08:06 AM
Hi igor,
Is there any chance you can gather a small project reproducing the issue ? I will be glad to have a look at it here and see what is wrong. . I believe this is the only way to find out what is going on .

Also just a tought - do you have JustCode installed ? It uses a specific version of Telerik dlls and may be related to the issue.

Kind regards,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
ifle
Top achievements
Rank 1
answered on 20 Jul 2010, 08:17 AM
Hi Pavel,

I created the test project that reproduce this issue. 
You can download it from that url
http://files.rsdn.ru/40838/TelerikVSPackage.zip


Regards,

Igor

P.S. I don't have JustCode, I prefer Resharper.


0
Erjan Gavalji
Telerik team
answered on 22 Jul 2010, 04:47 PM
Hi Igor,

The error happens because you're trying to initialize a ToolWindow in the Initialize phase of a VS integration package. Please, check the thread below, there is a discussion, containing some useful information of why this is not recommended:
http://connect.microsoft.com/VisualStudio/feedback/details/544234/findtoolwindow-call-on-a-vspackage-throws-exception-toolwindow-can-not-be-opened

If it is absolutely required that you load a toolwindow initially, you could use the approach in the attached sample file.

Cheers,
Erjan Gavalji
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
ifle
Top achievements
Rank 1
answered on 22 Jul 2010, 06:22 PM

 

Hi Erjan,

Thanks for you replay.

I tried to initialize a ToolWindow only for example. I don't required it. I haven't  problem with my tool window. I have problem after has added the telerik grid view.
I have another way to reproduce this issue:
1. Create the default Visual Studio Package extensibility project and in page 3 of the wizard you select to create a ToolWindow.
2. Open the MyControl.xaml and add the Telrik DataGridView such as :
<UserControl xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  x:Class="HarlandIsrael.TelerikVSPackage1.MyControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.10.0"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             Name="MyToolWindow"
             Background="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowBackgroundKey}}">
    <Grid>
        <StackPanel Orientation="Vertical">
            <TextBlock Margin="10" HorizontalAlignment="Center" Foreground="{DynamicResource {x:Static vsfx:VsBrushes.ToolWindowTextKey}}">This is a toolwindow with WPF content</TextBlock>
            <Button Content="_Click Me!" Width="80" Height="80" Name="button1" Click="button1_Click" />
            <telerik:RadGridView />
        </StackPanel>        
    </Grid>
</UserControl>
3. Run the project and click on the "My Tool Window" button under View->Other Windows

Thanks,
Igor
0
Accepted
Erjan Gavalji
Telerik team
answered on 27 Jul 2010, 01:19 PM
Hello Igor,

You would have to make sure the RadControls assemblies get loaded by Visual Studio. This can be done in several ways:
  • Add the RadControls assemblies to the GAC;
  • Add a handler to the AppDomain.CurrentDomain.AssemblyResolve event and return the specific RadControls assembly when searched;
  • Add the RadControls assemblies to the [VisualStudioInstallDir]\Common7\PublicAssemblies.

FYI, due to the specifics of the Visual Studio dialog handling, you might need to call the dialog several times when using the Trial RadControls. I did not have a problem with the Dev ones though.

Hope this helps,
Erjan Gavalji
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
ifle
Top achievements
Rank 1
answered on 28 Jul 2010, 08:42 AM
Thanks.
Are you going to fix loading issue in the next version?
0
Erjan Gavalji
Telerik team
answered on 28 Jul 2010, 12:34 PM
Hi Igor,

The message is part of the Trial policy of RadControls for WPF distribution.
The message is not displayed when the Dev version used.

Kind regards,
Erjan Gavalji
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
ifle
Top achievements
Rank 1
answered on 29 Jul 2010, 11:17 AM
I meant is not a trial message, a way of loading are telerik assemblies.
Tags
GridView
Asked by
ifle
Top achievements
Rank 1
Answers by
Vlad
Telerik team
ifle
Top achievements
Rank 1
B Jones
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Erjan Gavalji
Telerik team
Share this question
or