2013-07-19 70 views
0

制作一个WPF UI,有一个网格,一些行和文本块。 继承人CS为XAMl;不明资源由URI

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 
using System.Windows; 
using System.Windows.Controls; 
using System.Windows.Data; 
using System.Windows.Documents; 
using System.Windows.Input; 
using System.Windows.Media; 
using System.Windows.Media.Imaging; 
using System.Windows.Navigation; 
using System.Windows.Shapes; 
using System.Xaml; 
using Microsoft; 
using Microsoft.Expression; 
using Microsoft.Expression.Utility.ValueEditors; 
using IGotThis; 

namespace Project1 
{ 
    /// <summary> 
    /// Interaction logic for UserControl1.xaml 
    /// </summary> 
    public partial class UserControl1 : UserControl 
    { 
     public UserControl1() 
     { 
      InitializeComponent(); 
     } 
     void Page_Loaded(object sender, RoutedEventArgs e) 
     { 
      String[,] outlookArray = IGotThis.PullOutLookMessages.getOutlookMessages(); 
      this.OutLookInfo.DataContext = outlookArray; 
     } 
    } 

IGotThis是另一个CS,我认为它是无关的。 每当我调试程序,我的WPF设计页面被替换为:

异常:组件“Microsoft.Expression.Utility.ValueEditors.SplitComboBox”不具有由URI“/微软标识的资源。 Expression.Utility;组件/ valueeditors/splitcombobox.xaml”。

堆栈跟踪

在System.Windows.Application.LoadComponent(对象部件,乌里resourceLocator) 的InnerException:无。

我丝毫不明白这个错误。在我的xaml代码中, UserControl用蓝色的蠕虫标出了同样的错误。

编辑:我的继承人XAML

<UserControl x:Class="Project1.UserControl1" 
     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" 
     mc:Ignorable="d" Width="528" Height="556.4"> 
<Grid x:Name="OutLookInfo"> 
    <Grid.ColumnDefinitions> 
     <ColumnDefinition Width="Auto" MinWidth="98"></ColumnDefinition> 
     <ColumnDefinition></ColumnDefinition> 
    </Grid.ColumnDefinitions> 
    <Grid.RowDefinitions> 
     <RowDefinition Height="69*"></RowDefinition> 
     <RowDefinition Height="139*"></RowDefinition> 
     <RowDefinition Height="93*"></RowDefinition> 
     <RowDefinition Height="255*"></RowDefinition> 
    </Grid.RowDefinitions> 
    <TextBlock Text="Sender Name" HorizontalAlignment="Left" Height="22" Margin="0,23,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="98" FontSize="16" TextAlignment="Center"/> 
    <TextBlock Text="CC'd People" HorizontalAlignment="Left" Height="22" Margin="0,59,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="98" FontSize="16" TextAlignment="Center" Grid.Row="1"/> 
    <TextBlock Text="Subject" HorizontalAlignment="Left" Height="22" Margin="0,39,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="98" FontSize="16" TextAlignment="Center" Grid.Row="2"/> 
    <TextBlock Text="Body Text" HorizontalAlignment="Left" Height="22" Margin="0,112,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="98" FontSize="16" TextAlignment="Center" Grid.Row="3"/> 
    <TextBlock Text ="{Binding outlookArray}" Grid.Column="1" HorizontalAlignment="Left" Height="235" Margin="10,10,0,0" Grid.Row="3" TextWrapping="Wrap" VerticalAlignment="Top" Width="410"/> 
    <TextBlock Grid.Column="1" HorizontalAlignment="Left" Height="71" Margin="10,10,0,0" Grid.Row="2" TextWrapping="Wrap" VerticalAlignment="Top" Width="410" FontSize="18"/> 
    <TextBlock Grid.Column="1" HorizontalAlignment="Left" Height="119" Margin="10,10,0,0" Grid.Row="1" TextWrapping="Wrap" VerticalAlignment="Top" Width="410" FontSize="18"/> 
    <TextBlock Grid.Column="1" HorizontalAlignment="Left" Height="49" Margin="10,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="410" FontSize="18"/> 
</Grid> 

我不知道这是相关的,但我发现我的错误列表这样的警告:

Warning 1 There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Microsoft.Expression.Utility, Version=5.0.30709.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=x86", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. IGotThis 

我m不知道这意味着什么,或者如何更改“目标处理器架构”

+0

它看起来像你正在使用的组件引用程序集 - 尝试添加对“Microsoft.Expression.Utility.dll”的引用? – McGarnagle

+0

那个位置在哪里?我查看了添加引用中的每个选项卡,它并没有位于那里,如果我尝试使用using语句,它会给我一个没有引用的错误。 –

+0

进行了手动搜索,发现了带有Microsoft.Expression.Utility的.dll文件,但添加后告诉我他们已经被引用。 –

回答

0

修正了它。我认为可能必须这样做,我试图在控制台应用程序中运行WPF。我切换了,现在不会有任何错误。

+0

请详细说明。你是怎么做到的? –