简体   繁体   English

ASP.NET =>编译器错误消息:CS0246:类型或名称空间名称'HtmlAgilityPack'

[英]ASP.NET => Compiler Error Message: CS0246: The type or namespace name 'HtmlAgilityPack'

using HtmlAgilityPack;

// reference it //引用它

Produces error: ASP.NET => Compiler Error Message: CS0246: The type or namespace name 'HtmlAgilityPack' ... 产生错误:ASP.NET =>编译器错误消息:CS0246:类型或名称空间名称'HtmlAgilityPack'...

HtmlAgilityPack IS referenced in my web site. 我的网站中引用了HtmlAgilityPack。

Switched from ASP.NET 2.0 to 4.0. 从ASP.NET 2.0切换到4.0。 After that, got this error. 之后,出现此错误。 When making a console or windows forms application, all is fine, but ASP.NET build system gives me this error. 当制作一个控制台或Windows窗体应用程序时,一切都很好,但是ASP.NET构建系统给了我这个错误。 I have this compile error when using HtmlAgilityPack. 使用HtmlAgilityPack时出现此编译错误。

No luck till today fixing this. 直到今天解决这个问题,都没有运气。

Had the same problem, my .NET project was targeting .NET Framework 4.0 but HtmlAgilityPack.dll was build with .NET Framework 4.5. 遇到相同的问题,我的.NET项目面向.NET Framework 4.0,但HtmlAgilityPack.dll是由.NET Framework 4.5构建的。

The solution was to reference the HtmlAgilityPack.dll build with .NET Fx 4.0. 解决方案是引用带有.NET Fx 4.0的HtmlAgilityPack.dll构建。

The download package for HtmlAgilityPack offers versions for Net20, Net40, Net45 and even WinRT. HtmlAgilityPack的下载软件包提供了Net20,Net40,Net45甚至WinRT的版本。

Please set the Copy Local property to True on the Referenced DLL of HtmlAgilityPack 请在HtmlAgilityPack的引用DLL上将“ Copy Local属性设置为True

This will copy the dll to the output directory of your application 这会将dll复制到应用程序的输出目录

So it worked before you changed the Framework Version to .Net 4? 在将Framework版本更改为.Net 4之前,它是否奏效?

If that's the case that sounds more like you also need to upgrade your dll to .Net 4. 如果真是这样,您还需要将dll升级到.Net 4。

Just get the release from Codeplex , in the zip there is a version of the AgilityPack for every Framework Version there is, just get the one for .Net 4 and see if that changes anything. 只需从Codeplex获得发行版 ,则在zip中为每个Framework Version提供一个AgilityPack版本,只需为.Net 4获得一个版本,然后看看是否有任何改变。

暂无
暂无

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

相关问题 在ASP.NET vNext中使用Ninject时出现编译器错误CS0246(找不到类型或名称空间) - Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext 错误CS0246:找不到类型或名称空间名称“ HtmlAgilityPack” - Error CS0246: The type or namespace name `HtmlAgilityPack' could not be found 关于CS0246的ASP.NET:类型或命名空间名称 - 错误 - ASP.NET regarding CS0246: The type or namespace name - Error ASP.NET 核心 - 错误 CS0246 找不到类型或命名空间名称“ApplicationUserRole&lt;&gt;” - ASP.NET Core - Error CS0246 The type or namespace name 'ApplicationUserRole<>' could not be found 编译器错误消息:CS0246:找不到类型或名称空间名称 - Compiler Error Message: CS0246: The type or namespace name could not be found 编译器错误消息:CS0246:找不到类型或命名空间名称“Slider” - Compiler Error Message: CS0246: The type or namespace name 'Slider' could not be found 编译器错误消息:ASP.NET MVC App中的CS0246 - Compiler Error Message: CS0246 in ASP.NET MVC App 与ASP.NET和MVC 5一起出现错误...错误CS0246:找不到类型或命名空间 - error following along with ASP.NET and MVC 5… error CS0246: The type or namespace could not be found 如何解决 CS0246 错误:(类型或命名空间名称错误)? - How to resolve CS0246 ERROR: (The type or namespace name Error)? 错误 CS0246:找不到类型或命名空间名称“KustoConnectionStringBuilder” - error CS0246: The type or namespace name 'KustoConnectionStringBuilder' could not be found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM