我在发布我的网站时遇到一个奇怪的问题。我继承了这个项目,并且在我到达之前就开始了这个问题,所以我不知道是什么情况导致了问题的产生。发布网站某些页面失败
基本上,网站项目下的3个文件夹无法正确发布。将预编译的Web传输到主机时,必须将这三个文件夹从Visual Studio项目手动复制到主机(即它们不再是发布的版本)以使其工作。
如果发布操作的结果被留下,在该文件夹会导致以下错误的任何页面:
Server Error in '/' Application. Unable to cast object of type 'System.Web.Compilation.BuildResultNoCompilePage' to type 'System.Web.Compilation.BuildResultCompiledType'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.Compilation.BuildResultNoCompilePage' to type 'System.Web.Compilation.BuildResultCompiledType'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidCastException: Unable to cast object of type 'System.Web.Compilation.BuildResultNoCompilePage' to type 'System.Web.Compilation.BuildResultCompiledType'.] System.Web.UI.PageParser.GetCompiledPageInstance(VirtualPath virtualPath, String inputFile, HttpContext context) +254
System.Web.UI.PageParser.GetCompiledPageInstance(String virtualPath, String inputFile, HttpContext context) +171
URLRewrite.URLRewriter.ProcessRequest(HttpContext context) +2183
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +405 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +65Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832
没有人有任何想法,这些网页无法正常出版的可能原因可能是什么?我能看到的任何事情都可能表明问题的根源?
此外: 这是一个完全干净的每一次构建,所以旧的bin文件应该不会有问题。我还检查了bin文件夹中的项目的日期戳记,并且它们是最新的。
第二加法: 该项目最初是作为网站,而不是一个Web应用程序创建的。抱歉,模棱两可。
完成 - 不幸的是它没有任何好处。另外,当项目开始时,我并不在身边,所以我没有对项目类型进行任何控制。 – 2008-09-17 12:32:00
您可以使用ScottGu的博客上的工具轻松地将网站转换为Web应用程序(或者也可以在VS2005 SP1中?)。说真的,这就是我通常解决这些问题的方法! – Sklivvz 2008-09-17 21:37:34
我可能会单独尝试 - 但是,我们距离上线一周,我不希望在此阶段引入任何其他未解决的问题。 – 2008-09-18 16:13:15