网站在线时出现 Webconfig 错误

发布于 2024-11-06 00:30:31 字数 848 浏览 5 评论 0原文

我正在尝试发布一个网站

该出版物工作完美,但是当我尝试访问该地址时,它返回以下错误:

解析器错误消息:无法加载 文件或程序集 “Microsoft.Web.Helpers”或其之一 依赖关系。该组件已构建 通过比当前更新的运行时 已加载运行时且无法加载。

来源错误:

第 293 行: 第 294 行: 第 295 行: 第 296 行:
线 297:

源文件: C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config 线路:295

程序集加载跟踪:以下内容 信息可以帮助 确定装配原因 “Microsoft.Web.Helpers”不能 已加载。

警告:程序集绑定日志记录是 关闭。启用程序集绑定 失败记录,设置注册表 价值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) 到 1。 注意:有一些 与相关的性能损失 程序集绑定失败日志记录。转动 关闭此功能,删除注册表 价值 [HKLM\Software\Microsoft\Fusion!EnableLog]。

当我在本地站点上运行时,不会发生这种情况。

该应用程序是由 Sql Server WebMatrix Compac 4 开发的

I'm trying to publish a web site.

The publication works perfectly, but when I try to access the address it returns me the following error:

Parser Error Message: Could not load
file or assembly
'Microsoft.Web.Helpers' or one of its
dependencies. This assembly is built
by a runtime newer than the currently
loaded runtime and cannot be loaded.

Source Error:

Line 293:
Line 294:
Line 295: Line 296:
Line
297:

Source File:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\web.config
Line: 295

Assembly Load Trace: The following
information can be helpful to
determine why the assembly
'Microsoft.Web.Helpers' could not be
loaded.

WRN: Assembly binding logging is
turned OFF. To enable assembly bind
failure logging, set the registry
value
[HKLM\Software\Microsoft\Fusion!EnableLog]
(DWORD) to 1. Note: There is some
performance penalty associated with
assembly bind failure logging. To turn
this feature off, remove the registry
value
[HKLM\Software\Microsoft\Fusion!EnableLog].

This does not happen when I'm running on the local site.

The application was developed and Sql Server WebMatrix Compac 4

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

仙女 2024-11-13 00:30:31

如果您阅读错误消息,它显示“无法加载文件或程序集“Microsoft.Web.Helpers”或其依赖项之一。此程序集由比当前加载的运行时更新的运行时构建 并且无法加载。”如果您随后查看此站点尝试运行的 ASP.NET 版本,则会发现它是 ASP.NET 版本:2.0.50727.4209。

网页和 Web Helpers 库需要版本 4.0。确保网站面向正确的 ASP.NET 版本。

If you read the error message it says "Could not load file or assembly 'Microsoft.Web.Helpers' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded." If you then look at the version of the ASP.NET that this site is attempting to run under, it is ASP.NET Version:2.0.50727.4209.

Web Pages and the Web Helpers library need Version 4.0. Make sure the site targets the correct version of ASP.NET.

傲性难收 2024-11-13 00:30:31

对于缺少的程序集,一个简单的解决方案是将它们与您的项目捆绑在一起。
转到您的项目 ->参考资料->找到这个 microsoft web helpers ref ->打开属性面板并将Copy Local 设置为True

编辑:另请尝试设置程序集绑定日志记录。

For missing assemblies a simple solution is to just bundle them with your project.
Go to your project -> references -> find this microsoft web helpers ref -> open the properties panel and set Copy Local to True

Edit: Also try setting assembly binding logging.

初见你 2024-11-13 00:30:31

我怀疑您的 web.config 没有问题,并且您的部署中缺少程序集。

您可能必须在部署包中包含 microsoft.web.helpers 或将其复制到 bin 文件夹中。

您可能会发现缺少其他程序集,但您应该能够将它们一一挑选出来。

之前有一个问题 Hosting WebMatrix Page

列出了您必须部署的所有 dll,并建议使用网络部署

I suspect that your web.config is fine and that there is an assembly missing from your deployment.

You probably have to include microsoft.web.helpers in your deployment package or simply copy it to the bin folder.

You might find that there are other assemblies missing but you should be able to pick them off one by one.

There is a previous question Hosting WebMatrix Page

that lists all of the dlls you have to deploy and also suggests using Webdeploy

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文