ASP.NET发布网站的二个小问题总结

今天在一部刚刚好的电脑上发布一个做好的网站(Net 2.0),VS2005 Team suite英文版, 装了TFS方便团队开发, 在VS里面可以运行与调试, 生成也没提示出错, 但到发布网站那部总出现一个错误, 使用发布过程中断:Index was outside the bounds of the array。

感觉有点熟悉这个错误, 因为好久前我就试过这问题, 后来怎解决怎也想不起,在百度与google里找了差不多一个小时, 发现原来是差一个补丁, 真晕倒, 这时就想起来原因了。 发现工作中这些小问题还是要记下来, 以方便日后回忆。

这个补丁叫 hotfix补丁, 在Visual Studio SP1中有可能会遇到。 在这里直接下载

当这个设置完成后, 开始发布到IIS设定的目录上。 运行发现界面十分简结, 与我们做的完全不符。 只有一行红色大字体与几行小黑字体, 如下:

Server Application Unavailable
    The web application you are attempting to access on this web server is currently unavailable.Please hit the "Refresh" button in your web browser to retry your request.
  Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.

这时候去看一下日志, 发现错误日志中记录 aspnet_wp.exe  (PID: 2164) stopped unexpectedly.

原因是这电脑先装了IIS-->SQL2005-->VS2005-->VS6,因为每一个.net framework都有一个自己的aspnet_regiis版本,可能IIS上面用到的是1.1或其它的, 这里你发布了2.0的程序来这里运行, 没有匹配到2.0的版本。 所以只出现几句简结的字体。

那只有在运行中输入C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i 安装了aspnet。提示OK后就可以了。

原文地址:https://www.cnblogs.com/whtydn/p/1658415.html