将AppPool更改为.Net 4后,任何简单的aspx页面都停止加载

时间:2016-10-26 22:11:00

标签: asp.net .net iis-7.5

我有一个Web应用程序,我最近升级到.Net Framework 4.应用程序正在我们的生产服务器上运行OK。但是,我试图在我的本地Windows 2008R2开发计算机上设置它以前在.Net Framework 2下运行。但是每当我尝试加载一个aspx页面时,我得到一个"值不能为null&# 34;错误。下面列出了具有堆栈跟踪的错误页面示例;

Value cannot be null.
Parameter name: value
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.ArgumentNullException: Value cannot be null.
Parameter name: value

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: 
[ArgumentNullException: Value cannot be null.
Parameter name: value]
   System.String.IndexOf(String value, Int32 startIndex, Int32 count, StringComparison comparisonType) +400
   System.String.Contains(String value) +25
   MainNet.Global.Application_BeginRequest(Object sender, EventArgs e) +173
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +142
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +92

下面列出了一个简单的文本aspx页面,它将创建此错误;

<!doctype html>
<html lang="en">
  <head>
    <title>Test Page</title>
  </head>
  <body>

    <h1>This is a test page</h1>
    <h3>  1 + 2 = <%= (1+2).ToString() %></h3>
  </body>
</html> 

我将IIS中的ISAPI和CGI限制设置为&#34;允许&#34; for ASP.NET v4.0.30319

使用APS.NET v2.0.50727

运行网站时,目录权限没有变化

上面的示例代码在ASP.Net 2

下正常运行

我在这里缺少什么?

0 个答案:

没有答案