如何解决此错误类型或命名空间名称';主题信息';找不到

本文关键字:找不到 信息 命名空间 何解决 解决 类型 错误 | 更新日期: 2023-09-27 18:24:27

我如何解决这个错误

找不到类型或命名空间名称"ThemeInfo"(是否缺少using指令或程序集引用?)

AssemblyInfo.cs

using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Emgu.CV.WPF")]
[assembly: AssemblyDescription("")]
// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components.  If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set 
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>.  For example, if you are using US english
//in your source files, set the <UICulture> to en-US.  Then uncomment
//the NeutralResourceLanguage attribute below.  Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]

[assembly: ThemeInfo(
    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
    //(used if a resource is not found in the page, 
    // or application resource dictionaries)
    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
    //(used if a resource is not found in the page, 
    // app, or any theme specific resource dictionaries)
)]

如何解决此错误类型或命名空间名称';主题信息';找不到

添加对PresentationFramework.dll的引用。您有正确的using语句(using System.Windows;)。

我不得不添加

windowsbase.dll
PresentationFramework.dll
Presentationcore.dll