2013-05-14 98 views
0

我最近將我們開發區域中的多個網站從x86 Windows 2003(IIS6)遷移到x64 Windows 2008 R2(IIS7)。我使用「msdeploy」來執行遷移。最初我遷移了整個服務器,但遇到了問題,所以我最終只是遷移IIS配置,而不是腳本映射。經過幾次配置更改後,我終於能夠以集成模式獲得.NET 3.5站點的服務頁面。但是,我有主母版頁的這一部分的問題:jsdebug Web服務方法名稱無效

<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) 
  • 該網站的應用程序池是v2.0.050727集成的。
  • 「啓用32位應用程序= false」(翻轉這並沒有幫助)。
  • 該網站是爲「任何CPU」構建的。
  • 我有我的本地Win7框中運行II7下的相同網站和 一切運行良好。我看到的唯一區別是在「經典」模式下運行的應用程序池是 。我試圖用 將服務器切換到「經典」模式,結果相同。
  • 我試過設置debug="false"但我得到相同的錯誤(除了/ js而不是/ jsdebug)
  • 我已經運行了aspnet_regiis -i幾次。 2.0和4.0
  • 的64位版本我已經重新安裝過角色管理IIS和.NET 3.5.1幾次
  • 我能夠得到每個Web服務定義頁面的

我想重新安裝/修復.net 2.0,但在WinServer 2008中似乎不可能。我在其他地方讀過,重新安裝操作系統是實現此目的的唯一方法。這不是一個選項。

我是否在某處丟失了一個配置?任何幫助將不勝感激!

+0

同樣的問題出現後? http://stackoverflow.com/questions/5382239/request-for-wstestservice-asmx-jsdebug-returns-500-error-on-server-fine-in-deve – 2013-05-14 18:22:25

+0

這是同樣的錯誤,但不幸的是答案沒有解決我的問題。 – BFK 2013-05-14 21:14:01

回答

2

想通了。我將此處理程序添加到web.config中system.webServer/handlers下的列表頂部。腳本現在加載OK

<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和它的2.0處理程序「*的.asmx」