C# [System.Web.Script.Services.ScriptService]在所有情况下都无害吗?
我正在开发一个web服务,供我们的客户用于特定的处理目的。Visual Studio在我的asmx文件的顶部添加了一行,它告诉我:C# [System.Web.Script.Services.ScriptService]在所有情况下都无害吗?,c#,visual-studio-2010,web-services,asmx,C#,Visual Studio 2010,Web Services,Asmx,我正在开发一个web服务,供我们的客户用于特定的处理目的。Visual Studio在我的asmx文件的顶部添加了一行,它告诉我: // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. // [System.Web.Script.Services.ScriptService] 我不确定在哪些不同的场景中,这个web服务将被使用,因此我不能
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
我不确定在哪些不同的场景中,这个web服务将被使用,因此我不能决定对它进行注释或取消注释
我的问题是,在任何情况下取消注释都是无害的,还是这样做可能会导致安全问题?如果您的代码使用的是.asmx文件,那么请不要更改.asmx文件中的任何内容
因为.asmx文件需要
[System.Web.Script.Services.ScriptService]
。如果您删除此线路,您的服务方法将不会调用并导致错误。Sir。默认情况下,这一行被注释。我不会使用我的web服务,但我正在为我的客户开发它。web服务在某些情况下肯定会工作,但我不确定删除该注释是否会使web服务在某些情况下可用。