[英]The type or namespace 'Wpf' does not exist in the namespace 'Hamul.Emoji' (are you missing an assembly reference)?
I'm trying to use Emoji.Wpf
( https://github.com/samhocevar/emoji.wpf ) as shown in their examples but I keep hitting the error我正在尝试使用
Emoji.Wpf
( https://github.com/samhocevar/emoji.wpf ),如示例所示
The type or namespace 'Wpf' does not exist in the namespace 'Hamul.Emoji' (are you missing an assembly reference)?
when I use it like so:当我像这样使用它时:
...
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:emoji="clr-namespace:Emoji.Wpf;assembly=Emoji.Wpf"
...
.
.
.
<emoji:TextBlock x:Name="test" Text="test />
However, if I use just a regular TextBlock
<TextBlock x:Name="test" Text="test" />
instead of emoji:TextBlock
my project runs fine.但是,如果我只使用常规
TextBlock
<TextBlock x:Name="test" Text="test" />
而不是emoji:TextBlock
我的项目运行良好。 It's a bit puzzling because I do have a xlmns:x
entry and it works fine elsewhere except when trying to use it in any emoji
components.这有点令人费解,因为我确实有一个
xlmns:x
条目,并且它在其他地方工作正常,除非在任何emoji
组件中尝试使用它。 Moreover, if I use my emoji component like so:此外,如果我像这样使用我的表情符号组件:
<emoji:TextBlock Text="test" />
It works fine as well so the issue seems to be just with using x:Name
.它也可以正常工作,因此问题似乎只是使用
x:Name
。 Any help would be appreciated!任何帮助,将不胜感激!
If you pay close attention to the error message The type or namespace 'Wpf' does not exist in the namespace 'Hamul.Emoji' (are you missing an assembly reference)?
如果您密切注意错误消息
The type or namespace 'Wpf' does not exist in the namespace 'Hamul.Emoji' (are you missing an assembly reference)?
you may notice the Hamul
.您可能会注意到
Hamul
。
If you have installed the most recent version 0.3.3
of the package you will notice that this namespace does not exist in the assembly.如果您安装了 package 的最新版本
0.3.3
,您会注意到程序集中不存在此命名空间。 It's always Emoji.Wpf
.它总是
Emoji.Wpf
。
Please check your assembly references and make sure it points to the correct C:\Users\<user>\.nuget\packages\emoji.wpf\0.3.3\lib\netcoreapp3.1\Emoji.Wpf.dll
or C:\Users\<user>\.nuget\packages\emoji.wpf\0.3.3\lib\net40\Emoji.Wpf.dll
Please check your assembly references and make sure it points to the correct
C:\Users\<user>\.nuget\packages\emoji.wpf\0.3.3\lib\netcoreapp3.1\Emoji.Wpf.dll
or C:\Users\<user>\.nuget\packages\emoji.wpf\0.3.3\lib\net40\Emoji.Wpf.dll
Also debug this code同时调试此代码
public partial class App : Application
{
static App()
{
string assemblyLocation = Assembly.Load("Emoji.Wpf").Location;
}
}
And make sure that the file at the specified location is exactly 622 KB (636.928 bytes)
(net 4) or 622 KB (637.440 bytes)
(net core)并确保指定位置的文件正好是
622 KB (636.928 bytes)
(net 4)或622 KB (637.440 bytes)
(net core)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.