帮助解释错误? [英] Help interpreting error?

查看:52
本文介绍了帮助解释错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.NET 2.0 Web应用程序,可以在我当地的

机器上正常运行。但是,一旦我上传它,我就会收到此错误:


分析程序错误

描述:解析资源时出错

需要服务此请求。请查看以下具体的

解析错误详细信息并适当修改源文件。


解析器错误消息:文件''/ index.ascx.cs' '不存在。


来源错误:


第1行:<%@ Control Language =" c#" Inherits =" mysite.IndexContent"

CodeFile =" index.ascx.cs" %>


源文件:/index.ascx行:1


DLL位于远程服务器的bin文件夹中。所有的ASPX和ASCX

文件都在那里。任何想法?


谢谢,

Brett

解决方案




brett写道:


我有一个ASP.NET 2.0 Web应用程序在我的本地运行正常

机器。但是,一旦我上传它,我就会收到此错误:


分析程序错误

描述:解析资源时出错

需要服务此请求。请查看以下具体的

解析错误详细信息并适当修改源文件。


解析器错误消息:文件''/ index.ascx.cs' '不存在。


来源错误:


第1行:<%@ Control Language =" c#" Inherits =" mysite.IndexContent"

CodeFile =" index.ascx.cs" %>


源文件:/index.ascx行:1


DLL位于远程服务器的bin文件夹中。所有的ASPX和ASCX

文件都在那里。有什么想法吗?


谢谢,

Brett



你混合两种型号。一方面,您可以将CS文件发布到

服务器,这些类将按需编译。另一方面,

你可以发布一个或多个DLL。


在第一种情况下,你使用CodeFile属性引用CS文件。 br />

但是,在第二种情况下,你必须参考没有

" CodeFile"的文件。属性,但使用继承仅属性。在那个

的情况下,组件在bin中被查找。目录。如果您知道,也可以使用以下语法指定程序集名称:


inherits =" ControlName,AssemblyName"


通常情况下,当您使用网站时模型和发布它,ASCX和ASPX文件中的

引用自动更新为

第二种方式。


HTH,

Laurent

-

Laurent Bugnion,GalaSoft

软件工程: http://www.galasoft-LB.ch

PhotoAlbum: http://www.galasoft-LB.ch/pictures

支持儿童在加尔各答: http://www.calcutta-espoir.ch


感谢。这解决了第一个问题。但是当我从

上传本地Published文件夹中的内容时,我得到了这个:


我发现问题是我没有发布网站。我已经创建了一个本地发布的文件夹并在那里发布了
。然后我上传了

到远程服务器。现在我收到此错误:


解析器错误

描述:解析资源时发生错误

服务需要这个请求。请查看以下具体的

解析错误详细信息并适当修改源文件。


解析器错误消息:无法加载类型''mysite.Global'' 。

来源错误:

第1行:<%@ Application Inherits =" mysite.Global"语言= QUOT; C#" %>

源文件:/global.asax行:1

然后我在本地Published文件夹上创建了一个虚拟目录。当

我通过http访问它时,我得到了这个:


解析器错误

描述:解析过程中出错服务此请求所需的资源

。请查看以下具体的

解析错误详细信息并适当修改源文件。


解析器错误消息:文件''/ Published / index.ascx。 cs''没有

存在。

来源错误:

第1行:<%@ Control Language =" c#" Inherits =" mysite.IndexContent"

CodeFile =" index.ascx.cs" %>

源文件:/Published/index.ascx行:1

发布后是否应该查找CS文件?

谢谢,

Brett


我按照你的建议改变了aspx文件使用

inherits =" ControlName,AssemblyName"。显然发布

并没有改变它。


我仍​​然遇到Global.asax文件的问题。


谢谢,

Brett


I have an ASP.NET 2.0 web application that runs fine on my local
machine. However, once I upload it, I get this error:

Parser Error
Description: An error occurred during the parsing of a resource
required to service this request. Please review the following specific
parse error details and modify your source file appropriately.

Parser Error Message: The file ''/index.ascx.cs'' does not exist.

Source Error:

Line 1: <%@ Control Language="c#" Inherits="mysite.IndexContent"
CodeFile="index.ascx.cs" %>

Source File: /index.ascx Line: 1

The DLL is in the remote server''s bin folder. All of the ASPX and ASCX
files are there as well. Any ideas?

Thanks,
Brett

解决方案

Hi,

brett wrote:

I have an ASP.NET 2.0 web application that runs fine on my local
machine. However, once I upload it, I get this error:

Parser Error
Description: An error occurred during the parsing of a resource
required to service this request. Please review the following specific
parse error details and modify your source file appropriately.

Parser Error Message: The file ''/index.ascx.cs'' does not exist.

Source Error:

Line 1: <%@ Control Language="c#" Inherits="mysite.IndexContent"
CodeFile="index.ascx.cs" %>

Source File: /index.ascx Line: 1

The DLL is in the remote server''s bin folder. All of the ASPX and ASCX
files are there as well. Any ideas?

Thanks,
Brett

You are mixing two models. On one hand, you can publish CS files to your
server, and the classes will be compiled on demand. On the other hand,
you can publish one or more DLL.

In the first case, you refer to the CS file using the CodeFile attribute.

However, in the second case, you must refer to the file without the
"CodeFile" attribute, but using the "Inherits" attribute only. In that
case, the assembly gets looked for in the "bin" directory. You can also
specifiy the assembly name if you know it, using this syntax:

inherits="ControlName, AssemblyName"

Normally, when you use the "web site" model and "publish" it, the
references in the ASCX and ASPX files are automatically updated to the
second way.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch


Thanks. That fixed the first problem. But when I upload contents from
the local Published folder, I get this:

I found out the problem was that I wasn''t published the site. I''ve
created a local published folder and published there. Then I uploaded
to the remote server. Now I get this error:

Parser Error
Description: An error occurred during the parsing of a resource
required to service this request. Please review the following specific
parse error details and modify your source file appropriately.

Parser Error Message: Could not load type ''mysite.Global''.
Source Error:
Line 1: <%@ Application Inherits="mysite.Global" Language="C#" %>
Source File: /global.asax Line: 1

I then created a virtual directory on the local Published folder. When
I access it via http, I get this:

Parser Error
Description: An error occurred during the parsing of a resource
required to service this request. Please review the following specific
parse error details and modify your source file appropriately.

Parser Error Message: The file ''/Published/index.ascx.cs'' does not
exist.
Source Error:
Line 1: <%@ Control Language="c#" Inherits="mysite.IndexContent"
CodeFile="index.ascx.cs" %>
Source File: /Published/index.ascx Line: 1
Should it not be looking for CS files after being published?

Thanks,
Brett


I followed your suggestion and changed the aspx files to use
inherits="ControlName, AssemblyName". Apparently the publishing
doesn''t change it.

I still have the issue with the Global.asax file.

Thanks,
Brett


这篇关于帮助解释错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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