我们有一个asmx网络服务,可以在32位Windows服务器2008上运行良好,但是当它在64位服务器2008 r2机器上托管时,它会给出“索引超出数组的范围”。在尝试访问服务的javascript文件时:
http://www.site.com/Service.asmx/js输出“索引超出了数组的范围。”仅在托管在64位
时以下是服务代码的含义:
[WebService(Namespace = "http://www.company.com")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
[ScriptService]
public class Saver : WebService
{
/// <summary>A web service to save a set of ScheduleEntryProperties objects.</summary>
[WebMethod]
public string SaveEntries(Entry[] entries, object start, object end, string assignmentIDs, string deptID, string useCodes)
{
...
}
和Entry对象:
[Serializable]
public class Entry
{
public Entry()
{
}
public Entry(object assignmentID, object date, object hours, object text)
{
AssignmentID = assignmentID;
Date = date;
Hours = hours;
Text = text;
}
public object Date;
public object AssignmentID;
public object Text;
public object Hours;
}
有什么想法吗?
答案 0 :(得分:1)
原来这与IIS 7.5 <system.webServer />
配置部分以及定义为
<add name="*.asmx_*" path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" preCondition="integratedMode,runtimeVersionv2.0" />
所需要的只是删除preCondition =“integratedMode,runtimeVersionv2.0”并清除索引超出范围的错误。