我最近将我们开发区域中的多个网站从x86 Windows 2003(IIS6)迁移到x64 Windows 2008 R2(IIS7)。我使用“msdeploy”进行迁移。最初我迁移了整个服务器,但遇到了问题所以我最终只是迁移IIS配置减去脚本映射。经过一些配置更改后,我终于能够在集成模式下获得.NET 3.5站点服务页面。但是,我对主母版页的这一部分存在问题:
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
<Services>
<asp:ServiceReference Path="~/AjaxServices/FormSubmissionService.asmx" />
<asp:ServiceReference Path="~/AjaxServices/GMapDataService.asmx" />
<asp:ServiceReference Path="~/AjaxServices/ImageGalleryService.asmx" />
<asp:ServiceReference Path="~/AjaxServices/MyFavoritesService.asmx" />
</Services>
每个都会生成一个脚本标记,如:
<script src="../AjaxServices/FormSubmissionService.asmx/jsdebug" type="text/javascript"></script>
<script src="../AjaxServices/GMapDataService.asmx/jsdebug" type="text/javascript"></script>
<script src="../AjaxServices/ImageGalleryService.asmx/jsdebug" type="text/javascript"></script>
<script src="../AjaxServices/MyFavoritesService.asmx/jsdebug" type="text/javascript"></script>
正在访问网络服务,但在尝试访问“jsdebug”时出现以下错误:
System.InvalidOperationException: jsdebug Web Service method name is not valid.
at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
debug="false"
,但我得到了同样的错误(除了/ js而不是/ jsdebug)aspnet_regiis -i
。 x64版本的2.0和4.0 我想重新安装/修复.net 2.0,但这在WinServer 2008中似乎不可能。我在别处读到重新安装操作系统是实现此目的的唯一方法。那不是一个选择。
我错过了某处的配置吗?任何帮助将不胜感激!
答案 0 :(得分:2)
想通了。我将此处理程序添加到web.config中system.webServer / handlers下的列表顶部。脚本现在加载好了
<add name="ScriptHandlerFactory" path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" modules="ManagedPipelineHandler" scriptProcessor="" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="integratedMode" responseBufferLimit="4194304"/>
我实际上在列表中有这个处理程序,但它引用了4.0,它出现在“* .asmx”的2.0处理程序之后