简体   繁体   English

在升级ASP.NET之后注册httpHandlers?

[英]Register httpHandlers after upgrading ASP.NET?

I was asked to upgrade an ASP.NET web application from VS 2008 to VS 2010. After the upgrade there were a few issue that I fixed, mainly connectionStrings. 我被要求将ASP.NET Web应用程序从VS 2008升级到VS2010。升级后,我解决了一些问题,主要是connectionStrings。 But I started the application in debug mode to go through it and verify everything works. 但是我以调试模式启动了该应用程序以通过它并验证一切正常。 I noticed that I get a "Server Error" when clicking a link that has a report viewer. 我注意到单击具有报表查看器的链接时出现“服务器错误”。

The exact error is: 确切的错误是:

The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file. 报表查看器Web控件HTTP处理程序尚未在应用程序的web.config文件中注册。

Add <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, publicKeyToken=b08f5f1f11d90a3a" /> to the system.web/httpHandlers section of the web.config file.

I checked web.config and everything was the same except for version, which was 10.0.0.0. 我检查了web.config,除了版本为10.0.0.0之外,其他所有内容都相同。 I set it to 9.0.0.0. 我将其设置为9.0.0.0。 Doing this fixes the error for all reports. 这样做可以修复所有报告的错误。 But this is only a temporary solution because as soon as I open a report in design view, I am prompted to convert to RDLC 2008 format. 但这只是一个临时解决方案,因为在设计视图中打开报表后,系统会提示我转换为RDLC 2008格式。 If I convert it, I get the server error again and I get compile errors for the xml(version 1.0) files. 如果将其转换,则会再次出现服务器错误,并且会得到xml(1.0版)文件的编译错误。

I'm lost at what to do to fix this. 我不知道该怎么办。 Any suggestions? 有什么建议么?

So I figured out that there was an issue with my Visual Studio installation. 因此,我发现我的Visual Studio安装存在问题。 My web application worked fine, including the reports, when I would debug it. 当我调试它时,我的Web应用程序运行良好,包括报告。 But then the reports would stop working, even reports that worked a few seconds ago. 但随后,报告将停止工作,即使几秒钟前仍有效。 I then noticed that the web.config file had changed from 然后,我注意到web.config文件已从

Add <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, publicKeyToken=b08f5f1f11d90a3a" />

TO

Add <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, publicKeyToken=b08f5f1f11d90a3a" />

The versions would change on there own without notification. 版本将自行更改,恕不另行通知。 I checked with the other programmers and they did not encounter this specific issue. 我与其他程序员核对之后,他们没有遇到此特定问题。 So one of them suggested for me to reinstall VS 2010 and check if the issue occurs again. 因此,其中一位建议我重新安装VS 2010,并检查问题是否再次发生。 What do you know, the issue was resolved after reinstalling VS 2010. 您知道什么,重新安装VS 2010后该问题已解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM