无法加载程序集"App_Web_kh7-x3ka".在访问页面之前,请确保已对其进行了编译 [英] Could not load the assembly 'App_Web_kh7-x3ka'. Make sure that it is compiled before accessing the page

查看:71
本文介绍了无法加载程序集"App_Web_kh7-x3ka".在访问页面之前,请确保已对其进行了编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法弄清楚我在做什么错.我将网站发布到服务器上,当我尝试运行它时,出现以下异常:

I can't seem to figure out what I am doing wrong here. I publish my website to my server and when I try to run it I get the following exception:

无法加载程序集"App_Web_kh7-x3ka".在访问页面之前,请确保已对其进行编译.

Could not load the assembly 'App_Web_kh7-x3ka'. Make sure that it is compiled before accessing the page.

有没有其他人遇到过这个?

Has anyone else ever encountered this?

推荐答案

当您处理了一个预编译的aspx页并对其进行编辑(就好像未编译一样)时,例如从Live服务器中复制它并覆盖您的开发/工作版本.

This can also happen when you've taken a pre-compiled aspx page and edited it as if uncompiled, such as copying it from the Live server and overwriting your dev/working version.

在aspx页面的<%@ Page/> 标记内的第一行上,您可能会看到如下属性:

On the first line of your aspx page within the <%@Page /> tag you'll probably see an attribute like:

inherits ="yourPageClass,App_Web_kh7-x3ka" .

删除" App_Web_XXXX "部分,并添加指向文件后面的代码的CodeFile属性:

Delete the "App_Web_XXXX" part and add the CodeFile attribute pointing to your code behind file:

CodeFile ="yourPageFile.aspx.cs"

<%@ Page/> 标记现在看起来应该与从头开始创建新页面时类似.

The <%@Page /> tag should now look similar to when you create a new page from scratch.

当您的Asp.Net页面被预编译以发布到生产服务器时,对后面代码的引用将替换为对具有 App_Web_XXXX 名称的已编译DLL的引用.

When your Asp.Net pages are precompiled for release to the production server, references to the code behind are replaced with references to the compiled DLLs which have the App_Web_XXXX name.

这篇关于无法加载程序集"App_Web_kh7-x3ka".在访问页面之前,请确保已对其进行了编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆