如何修复ASP.NET错误“文件”nnn.aspx“尚未预编译,不能被请求。 [英] How to fix ASP.NET error "The file 'nnn.aspx' has not been pre-compiled, and cannot be requested."?

查看:866
本文介绍了如何修复ASP.NET错误“文件”nnn.aspx“尚未预编译,不能被请求。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个VS 2005网站,我发布使用发布网站,我清除所有三个复选框。我还有一个部署项目,可以拾取已发布的文件并创建一个MSI。然后我将该软件包安装在单独的测试服务器上。

I have a VS 2005 web site that I publish using "Publish Web Site", and I clear all the three checkboxes. I also have a deployment project that picks up the published files and creates an MSI. I then install the package on a separate test server.

换句话说,整个站点都是预编译的。但是,当我在一个名为服务的特定子文件夹中的任何.aspx文件中,我得到一个HttpException:

In other words, the whole site is pre-compiled. However, when I go to any .aspx file in a specific subfolder named "Services", I get an HttpException:


System.Web。 HttpException:文件'/myapp/Services/mypage.aspx'尚未被预编译,无法被请求。

System.Web.HttpException: The file '/myapp/Services/mypage.aspx' has not been pre-compiled, and cannot be requested.

如果我去另一个文件夹中的.aspx文件,无论是根还是其他子文件夹,它都可以正常工作。

If I go to an .aspx file in an other folder, be it the root or other subfolder, it works properly.

mypage.aspx本身的内容是:code><%@ Page Language =C#AutoEventWireup =trueCodeFile =mypage.aspx.csInherits =Services_mypage%>

The contents of mypage.aspx itself is: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="mypage.aspx.cs" Inherits="Services_mypage" %>"

/ myapp / bin 文件夹中,我可以看到一个 mypage.aspx.989dc2fb.compiled 文件,这个内容似乎指向bin文件夹中的某个程序集。

In the /myapp/bin folder I can see a mypage.aspx.989dc2fb.compiled file. The content of this seems to point to a certain assembly that is also present in the bin folder.

为什么会出现此错误?在那里,程序集是在那里,有问题的类型存在于该程序集中(我可以在Object Browser中看到它)输入.compiled文件的名称或内容?我有错误的版本吗?在.compiled文件名中看似随机的数字是什么意思呢,这很重要?

Why is this error occurring? The .compiled file is there, and the assembly is there, and the type in question is present in that assembly (I can see it in Object Browser). Is it something about the name or the content of the .compiled file? Do I have the wrong version somehow? What does the seemingly random number in the .compiled filename mean and is it important?

我还想提到这个问题突然出现,我不知道更改可能已经完成,因为它几天前正常工作(但据我所知,没有)。

I also want to mention that this issue appeared suddenly, and I'm not sure what changes there can have been done since it worked properly a few days ago (but to the best of my knowledge, none).

推荐答案

我没有这个错误,但是经过一番谷歌搜索,我遇到了这个链接,我不知道你是否看过它: http://forums.asp.net/t/956297.aspx

I've not had that error, but after a little Googling I came across this link, I'm not sure if you've seen it yet: http://forums.asp.net/t/956297.aspx

编辑(添加密钥文本):

Edit (adding the key text):


当在web.config中指定引用时,将出现此错误,并且deployment folder / site不包含安装在系统或bin文件夹不包含它们(如果它们是私有程序集)。
例如:(add assembly =Namespace1.NameSpace2,Version = xxxx,Culture = neutral,PublicKeyToken = 31bf3856ad364e35/)
如果您的web.config包含任何这样的程序集,并且部署的服务器不包含这些在bin或GAC中进行汇编,则会出现此错误。

This error will come when a reference is specified in web.config and deployment folder/site does not contain these dlls installed in the system or bin folder does not contain them(if they are private assemblies). For Example: (add assembly="Namespace1.NameSpace2, Version=x.x.x.x, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/) if your web.config contains any assemblies like this and deployed server doesnot contain these assembiles in bin or GAC, then this error will occur.

人们报告目标服务器上缺少的程序集最终成为根因为在他们的情况下,但他们有与你相同的错误。

People were reporting that missing assemblies on the destination server ended up being the root cause, in their cases, but they had the same error as you. Weird.

也许这是问题?

这篇关于如何修复ASP.NET错误“文件”nnn.aspx“尚未预编译,不能被请求。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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