this is an asxm file, copy the code into a cs file and then compile it into a dll and copy the dll to the bin directory of your virtual directoryof course, you also need to remove the code from the asmx and just leave<%@ WebService Language="C#" Class="Wrox.FT2ASPNET.EmployeesService" %>

解决方案 »

  1.   

    我看的书上是使用wsdl.exe生成cs文件,再用csc生成dll文件,我觉得太麻烦。是否有其它方式能直接将asmx的一个文件直接编译成dll文件?谢谢。
      

  2.   

    另我的wsdl.exe等文件路径为D:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin\wsdl.exe,无法运行,本人将单个文件复制到其它目录可以运行,但有错误;错误提示的刷新速度太快我无法看清。
    如果有其它编译方式,则上述问题就简单了。
      

  3.   

    wsdl.exe的作用是生成代理类你需要把D:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin\
    添加到环境变量中才能直接运行
    或者使用vs.net中提供的vs.net 命令提示工具才行错误提示的刷新速度太快我无法看清。
    你不要直接使用wsdl,先进入命令行工具,在使用wsdl
    这样就可以看到出什么错误了
      

  4.   

    1、我把路径添加到环境变量中wsdl.exe能直接运行
    2、使用vs.net中提供的vs.net 命令提示工具,我不太明白,能否详细说明,或告知对应书名和出版社。
    谢谢
      

  5.   

    1。默认情况下,不会把wsdl.exe所在的目录添加到环境变量中
    2,你打开开始--〉所有程序--〉vs.net 2003-->vs.net 工具--〉vs.net 2003 命令提示
    其实就是命令行,不过是打开时设定了路径,可以直接使用vs.net提供的工具而已