net 将WebService生成dll文件

通过dll来引用webservice的方法

1.打开浏览器,然后写输入http://192.168.0.2/RentService.asmx?wsdl

2.然后选择浏览器->文件->另存为RentService.wsdl

3.然后用vs的命令提示符来编译,输入:wsdl /namespace:NRentService /l:CS /urlkey:webconfigappsettingkeyname E:RentService.wsdl

4.然后会在:D:Program FilesMicrosoft Visual Studio 10.0VC目录下生成一个RentServie.cs的类

5.最后再执行命令:csc /out:RentService.dll /t:library RentService.cs ,其中RentService.cs为代理类文件,执行生成RentService.dll

6.最后在项目中引用dll就可以使用了

原文地址:https://www.cnblogs.com/chen110xi/p/4969511.html