zengdj

点滴经验,源自实践

博客园 首页 新随笔 联系 订阅 管理
 

在VS 2005中碰到如下问题:
The following error occurs when lauching a page  after conversion. The project is building correctly

We have cleared the Temporay Asp.NET  files and Bin directory and rebuilt the probject with the same results.  

 

Server Error in '/NewPort' Application.

--------------------------------------------------------------------------------

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 type 'NewPort.Global' is ambiguous: it could come from assembly 'c:\inetpub\wwwroot\NewPort\bin\NewPort.DLL' or from assembly 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\NewPort\07690470\8276eef8\App_Code.xh-j8gvn.DLL'. Please specify the assembly explicitly in the type name.

Source Error:

Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="NewPort.Global" %>

Source File: /NewPort/global.asax Line: 1

原因是:App_Code目录中的*.cs文件没有被编译到Assembly中去。

解决方法是:重命名App_Code目录(在VS中不能重命名该目录,可直接重命名硬盘目录)或将*.cs文件移到别的目录中去。这只是实践经验总结,是否有其他更好的方法不得而知。

posted on 2007-08-29 04:59  DingJun  阅读(688)  评论(0编辑  收藏  举报