[英]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
未编译:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.