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

查看:17
本文介绍了如何修复 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.

换句话说,整个站点都是预编译的.但是,当我转到名为Services"的特定子文件夹中的任何 .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 本身的内容是:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="mypage.aspx.cs" Inherits="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.

为什么会出现这个错误?.compiled 文件在那里,程序集也在那里,有问题的类型存在于那个程序集中(我可以在对象浏览器中看到它).是关于 .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 中指定引用并且部署文件夹/站点不包含系统中安装的这些 dll 或 bin 文件夹不包含它们(如果它们是私有程序集)时,将出现此错误.例如:(添加 assembly="Namespace1.NameSpace2, Version=x.x.x.x, 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天全站免登陆