繁体   English   中英

该项目未引用程序集“ SharedProject1”

[英]Assembly 'SharedProject1' is not referenced by this project

因此,在一个解决方案中,我有一个WPF项目和一个SharedProject。

SharedProject有一个ResourceDictionary文件。 我从WPF项目中引用了SharedProject。

在此处输入图片说明

但是,当我尝试引用ResourceDictionaryit时,会显示以下消息:“此项目未引用程序集'SharedProject1'”。

<Window x:Class="WPF.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:ietstesten"
    mc:Ignorable="d"
    Title="MainWindow" Height="350" Width="525">
<Window.Resources>
    <ResourceDictionary Source="pack://application:,,,/SharedProject1;component/Dictionary1.xaml" />
</Window.Resources>
<Grid>

</Grid>

您应该将ResourceDictionary添加到WPF Custom Control Library项目或WPF User Control Library项目中,并引用该项目。

Shared Project未编译:

Visual Studio 2015中的共享项目和类库有什么区别?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM