2011-04-09 7 views
1

GalaSoft.MvvmLight (런타임 버전 v2.0.50727, 버전 0.0.0.0) 및 GalaSoft.MvvmLight.Extras (런타임 v2.0.50727)를 추가 한 후 디자이너를 designtime으로 볼 수 없습니다. 버전 0.0.0.0) dll. 디자인 타임에이 예외가 발생합니다.디자인 타임에 WPF 디자이너를 볼 수 없습니다.

System.IO.FileLoadException 수 없습니다 로드 파일 또는 어셈블리 ' 문화 = 중립 GalaSoft.MvvmLight, 버전 = 0.0.0.0, PublicKeyToken = null이' 또는 해당 종속성 중 하나. 작동 은 지원되지 않습니다. ( HRESULT : 0x80131515 예외)에서 System.Reflection.RuntimeAssembly. nLoad (의 AssemblyName 파일 이름, 문자열 코드베이스, 증거 RuntimeAssembly assemblySecurity, locationHint, StackCrawlMark & stackMark, 부울 throwOnFileNotFound, 부울 forIntrospection, 부울 suppressSecurityChecks) System.Reflection.RuntimeAssembly.nLoad (의 AssemblyName 대신 파일명, 문자열 코드베이스, 증거 RuntimeAssembly assemblySecurity, locationHint, StackCrawlMark & stackMark, 부울 throwOnFileNotFound, 부울 forIntrospection, 부울 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName ( 의 AssemblyName assemblyRef 증거 assemblySecurity에서 suppressSecurityChecks 451,515,) StackCrawlMark & MS에서 System.Reflection.Assembly.Load ( 의 AssemblyName assemblyRef)에서 stackMark 부울 forIntrospection, 부울 suppressSecurityChecks) .Internal.Package.VSIsolationProviderService.RemoteReferenceProxy.VsReflectionResolver.GetRuntimeAssembly 에서 Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.CachingReflectionResolver.GetRuntimeAssembly (조립 reflectionAssembly)에서 (조립 reflectionAssembly) Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.Microsoft.Windows.Design.Metadata.IReflectionResolver.GetRuntimeAssembly Microsoft.Windows.Design에서 MS.Internal.Metadata.ClrAssembly.GetRuntimeMetadata (객체 reflectionMetadata)에서 (조립 reflectionAssembly). MS.Internal.Metadata.ClrAssembly.GetAttributes에서 Microsoft.Windows.Design.Metadata.AttributeTableContainer.GetAttributes (조립 조립, 유형 AttributeType에, Func`2 reflectionMapper)에서 Metadata.AttributeTableContainer.d _c.MoveNext() (ITypeMetadata attributeType) at MS.Internal.Design.Metadata.Xaml.XamlAssembly.get_XmlNamespaceCompatibility 매핑() MS.Internal에서 Microsoft.Windows.Design.Metadata.Xaml.XamlExtensionImplementations.GetXmlNamespaceCompatibilityMappings Microsoft.Windows.Design.Metadata.Xaml.XamlExtensions.GetXmlNamespaceCompatibilityMappings에서 (IAssemblyMetadata sourceAssembly) (IAssemblyMetadata 소스)에 . MS.Internal.Design.Markup.XmlElement.BuildScope에서 MS.Internal.Design.Metadata.ReflectionProjectNode.SubsumingNamespace (식별자 식별자) (PrefixScope parentScope, IParseContext 컨텍스트)에서의 Design.Metadata.ReflectionProjectNode.BuildSubsumption() MS.Internal.Design.Markup.XmlElement.ConvertToXaml (XamlElement 부모 PrefixScope parentScope, IParseContext 컨텍스트 IMarkupSourceProvider 공급자) MS.Internal.Design.DocumentModel.DocumentTrees에서 MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse에서 (부울 convertToXamlWithErrors) MS.Internal.Host에서 Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.get_LoadState()에서 Microsoft.Windows.Design.DocumentModel.Trees.ModifiableDocumentTree.get_ModifiableRootItem()에서 .Markup.XamlSourceDocument.get_RootItem() .PersistenceSubsystem.Load() at MS.Internal.Host.Designer.Loa MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load (IsolatedView 관점에서 MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load()에서 MS.Internal.Designer.VSDesigner.Load() 에서 D()) MS에서 MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner (IsolatedDesignerFactory 공장 MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner (IsolatedDesignerFactory 공장 IsolatedView 뷰) IsolatedView 뷰)에서 .Internal.Host.Isolation.IsolatedDesigner.Load() at MS.Internal.Designer.DesignerPane.LoadDesignerView()

System.NotSupportedException 시도 어셈블리가 .NET 프레임 워크의 이전 버전에서 샌드 박스 로 인한 것 네트워크 위치에서 어셈블리 을로드하려고했습니다. 이 .NET Framework 릴리스는 기본적으로 CAS 정책을 사용하지 않으므로이로드는 일 수 있습니다. 이로드가 조립품 샌드 박스를위한 이 아닌 경우 loadFromRemoteSources 스위치를 사용하도록 설정하십시오. 자세한 내용은 http://go.microsoft.com/fwlink/?LinkId=155569 을 참조하십시오.

.NET Framework 4.0, WPF with C#을 사용하고 있습니다.

여기에 내 코드

<Window x:Class="TreeviewApp.MainWindow" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras" 
xmlns:dataGrid="http://schemas.microsoft.com/wpf/2008/toolkit" 
Title="MainWindow" Height="350" Width="525"> 
<Window.Resources> 
<DataTemplate x:Key="DetailTemplate"> 
<TextBlock Text="{Binding Swift_File_Name}"/> 
</DataTemplate> 
<HierarchicalDataTemplate x:Key="MasterTemplate" 
ItemsSource="{ Binding SwiftCol,Mode=TwoWay}" 
ItemTemplate="{StaticResource DetailTemplate}"> 
<HierarchicalDataTemplate.ItemContainerStyle> 
<Style TargetType="TreeViewItem"> 
<Setter Property="IsSelected" Value="{Binding IsExpanded,Mode=TwoWay}"/> 
</Style> 
</HierarchicalDataTemplate.ItemContainerStyle> 
<TextBlock Text="{Binding CITA_Info_Id}"/> 
</HierarchicalDataTemplate> 
<!--<Style TargetType="TreeViewItem"> 
<Setter Property="IsExpanded" Value="True" /> 
</Style>--> 
  
  
  
  
<!--<Style x:Key="myStyle" TargetType="TreeViewItem"> 
<Setter Property="IsExpanded" Value="True" /> 
</Style>--> 
</Window.Resources> 
<Grid> 
<Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="428,0,0,0" Name="button1" Command="{Binding btnClick}" VerticalAlignment="Top" Width="75" /> 
<TreeView Height="288" HorizontalAlignment="Left" Margin="18,23,0,0" VerticalAlignment="Top" Width="89" 
x:Name="tvCita" ItemsSource="{Binding CitaCol,Mode=TwoWay}" ItemTemplate="{StaticResource MasterTemplate}"> 
<TreeView.ItemContainerStyle> 
<Style TargetType="{x:Type TreeViewItem}"> 
<Setter Property="IsExpanded" Value="True"/> 
</Style> 
</TreeView.ItemContainerStyle> 
<i:Interaction.Triggers> 
<i:EventTrigger EventName="SelectedItemChanged"> 
<cmd:EventToCommand Command="{Binding TreeviewItemClick}" CommandParameter="{Binding SelectedItem, ElementName= tvCita, Mode=OneWay}"/> 
</i:EventTrigger> 
</i:Interaction.Triggers> 
</TreeView> 
<dataGrid:DataGrid Name="dgSwift" Margin="105,24,0,0" ItemsSource="{Binding Path = SwiftCol}" AutoGenerateColumns="False" CanUserAddRows="False"> 
<dataGrid:DataGrid.Columns> 
<dataGrid:DataGridTextColumn Header="0000" Binding="{Binding Path = Line_0000_count}"></dataGrid:DataGridTextColumn> 
<dataGrid:DataGridTextColumn Header="1000" Binding="{Binding Path = Line_1000_count}"></dataGrid:DataGridTextColumn> 
<dataGrid:DataGridTextColumn Header="1100" Binding="{Binding Path = Line_1100_Count}"></dataGrid:DataGridTextColumn> 
<dataGrid:DataGridTextColumn Header="1110" Binding="{Binding Path = Line_1110_count}"></dataGrid:DataGridTextColumn> 
</dataGrid:DataGrid.Columns> 
</dataGrid:DataGrid> 
</Grid> 
</ 
Window> 

하지만, 모든 기능은 잘 작동된다. 이 디자이너 문제를 해결하는 방법을 알려주십시오.

+0

오류의 링크에서 제안을 시도 했습니까? http://go.microsoft.com/fwlink/?LinkId=155569 –

+0

[Fusion log viewer.] (http://msdn.microsoft.com/en-us/library/e74a18c4)를 사용하여 디버깅 할 수 있습니다. (v = VS.100) .aspx) 디버깅을 시도하기 전에 admin으로 실행하고 로그를 켜고 재부팅하십시오. CLR에서 어셈블리를 찾고있는 위치와 버전을 확인할 수 있습니다. 또한 CLR에서 찾을 수없는 이유를 확인할 수 있습니다 (설치된 경우에도 해당). – Will

+0

본 적이 있습니까 http://stackoverflow.com/questions/2714417/mvvm-light-toolkit-throws-an-system-io-fileloadexception –

답변

0

이벤트 트리거 기능에 오류가 발생했습니다. 디자인 타임에는 이유 디자인을 사용할 수 없습니다. 또한이 코드로 데이터 격자 검사에서 약간의 오류가 발생했습니다

<Window x:Class="TreeviewApp.MainWindow" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras" 
xmlns:dataGrid="http://schemas.microsoft.com/wpf/2008/toolkit" 
Title="MainWindow" Height="350" Width="525"> 
    <Window.Resources> 
     <DataTemplate x:Key="DetailTemplate"> 
      <TextBlock Text="{Binding Swift_File_Name}"/> 
     </DataTemplate> 
     <HierarchicalDataTemplate x:Key="MasterTemplate" 
ItemsSource="{ Binding SwiftCol,Mode=TwoWay}" 
ItemTemplate="{StaticResource DetailTemplate}"> 
      <HierarchicalDataTemplate.ItemContainerStyle> 
       <Style TargetType="TreeViewItem"> 
        <Setter Property="IsSelected" Value="{Binding IsExpanded,Mode=TwoWay}"/> 
       </Style> 
      </HierarchicalDataTemplate.ItemContainerStyle> 
      <TextBlock Text="{Binding CITA_Info_Id}">   
      </TextBlock> 
     </HierarchicalDataTemplate> 
    </Window.Resources> 
    <Grid> 
     <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="428,0,0,0" Name="button1" Command="{Binding btnClick}" VerticalAlignment="Top" Width="75" /> 
     <TreeView Height="288" HorizontalAlignment="Left" Margin="18,23,0,0" VerticalAlignment="Top" Width="89" x:Name="tvCita" ItemsSource="{Binding CitaCol,Mode=TwoWay}" ItemTemplate="{StaticResource MasterTemplate}"> 
      <TreeView.ItemContainerStyle> 
       <Style TargetType="{x:Type TreeViewItem}"> 
        <Setter Property="IsExpanded" Value="True"/> 
       </Style> 
      </TreeView.ItemContainerStyle> 
      <!--<i:Interaction.Triggers> 
       --><!--<i:EventTrigger EventName="SelectedItemChanged"> 
        <cmd:EventToCommand Command="{Binding TreeviewItemClick}" CommandParameter="{Binding SelectedItem, ElementName= tvCita, Mode=OneWay}"/> 
       </i:EventTrigger>--><!-- 
      </i:Interaction.Triggers>--> 
     </TreeView> 
     <DataGrid Name="dgSwift" Margin="105,24,0,0" ItemsSource="{Binding Path = SwiftCol}" AutoGenerateColumns="False" CanUserAddRows="False"> 
      <DataGrid.Columns > 
        <DataGridTextColumn Header="0000" Binding="{Binding Path = Line_0000_count}"></DataGridTextColumn> 
        <DataGridTextColumn Header="1000" Binding="{Binding Path = Line_1000_count}"></DataGridTextColumn> 
        <DataGridTextColumn Header="1100" Binding="{Binding Path = Line_1100_Count}"></DataGridTextColumn> 
        <DataGridTextColumn Header="1110" Binding="{Binding Path = Line_1110_count}"></DataGridTextColumn> 
      </DataGrid.Columns> 
     </DataGrid> 
    </Grid> 
</Window> 
+0

이것은 전혀 대답이 아닙니다 .. – pix

관련 문제