简体   繁体   English

命名空间“Hamul.Emoji”中不存在类型或命名空间“Wpf”(您是否缺少程序集引用)?

[英]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.Wpfhttps://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.

相关问题 类型或名称空间名称在名称空间中不存在“是否缺少程序集引用?” - The type or namespace name does not exist in the namespace ''are you missing an assembly reference ?" 命名空间中不存在类型或命名空间名称(您是否缺少程序集引用?) - The type or namespace name does not exist in the namespace (are you missing an assembly reference?) WPF类型或名称空间名称“浏览器”在名称空间“ System.Windows”中不存在(您是否缺少程序集引用?) - WPF The type or namespace name 'Browser' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) 在using语句中无法识别命名空间。 “名称空间&#39;#&#39;中不存在类型或名称空间&#39;#&#39;。是否缺少程序集引用? - Namespace not recognised in using statement. "The type or namespace '#' does not exist in the namespace '#'. Are you missing an assembly reference? 命名空间中不存在类型或命名空间名称(是否缺少程序集引用?)- 无法引用 class - The type or namespace name does not exist in the namespace (are you missing an assembly reference?) - Can't reference a class 类型或名称空间“ IsolatedStorage”在名称空间“ System.IO”中不存在(您是否缺少程序集或引用?) - The type or namespace 'IsolatedStorage' does not exist in the namespace 'System.IO' (are you missing an assembly or reference?) 类型或名称空间名称&#39;PointOfService&#39;在名称空间&#39;Microsoft&#39;中不存在(您是否缺少程序集引用?) - The type or namespace name 'PointOfService' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) 类型或名称空间名称“ OleDb”在名称空间“ System.Data”中不存在(您是否缺少程序集引用?) - The type or namespace name 'OleDb' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) 命名空间“System.Web”中不存在类型或命名空间名称“Mvc”(您是否缺少程序集引用?) - The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) 类型或名称空间名称“ ToolkitScriptManager”在名称空间“ AjaxControlToolkit”中不存在(您是否缺少程序集引用?) - The type or namespace name 'ToolkitScriptManager' does not exist in the namespace 'AjaxControlToolkit' (are you missing an assembly reference?)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM