Wsdl 从不更新
无论我在 Visual Studio 中的 asmx 服务中进行什么更改,WSDL 文件始终保持不变。当我浏览到服务定义时,删除方法、更改方法签名没有任何效果。
No matter what I change in an asmx service in Visual Studio, the WSDL file stays always the same. Deleting methods, changing method signatures don't have any effect when I browse to service definition.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我也遇到过类似的问题。
当删除枚举并将其替换为字符串时,枚举不会从 wsdl 中消失。无论我尝试什么(清理、重建、清除浏览器缓存、其他浏览器),它都会将枚举作为 WSDL 中的复杂类型返回。
我的解决方案是通过 Windows 资源管理器删除项目的本地文件夹,然后从 TFS 执行获取最新版本。此后问题就解决了。
当然,此解决方案仅适用于使用源代码控制系统的情况。
I have had a simular problem.
When removing an enum and replacing it by a string, the enum wouldn't go away from the wsdl. No matter what I tried (clean, rebuild, clear browser cache, other browser), it kept returning the enum as a complex type within the WSDL.
The solution in my case was remove the local folders of the project via windows explorer, then perform a get latest from TFS. After this the problem was solved.
Of course this solution only aplies when using a sourcecontrol system.
更改服务后,您必须构建它并确保新版本正在运行。一种快捷方式是构建它(并确保没有错误),然后右键单击 .ASMX 文件并选择“在浏览器中查看”。
另外,尽管我确信您已经意识到这一点,但您不应该使用 ASMX Web 服务进行新开发。 Microsoft 现在认为 ASMX 是一项遗留技术。请改用 WCF。
After changing your service, you must build it and ensure that the new version is running. One shortcut would be to build it (and make sure there are no errors), then right-click the .ASMX file and choose "View in Browser".
Also, although I'm sure you're aware of it, you should not be using ASMX web services for new development. Microsoft now considers ASMX to be a legacy technology. Use WCF instead.
我遇到过这个问题并且有解决方案。
原因:当您在 Visual Studio 中创建新的“Web 服务”项目时,它会自动将“Service1.asmx”文件添加到您的项目中。您重命名该文件并更改其中的类声明,但 Studio 仍然认为它是“Service1”,wnd 只会显示“Service1”的 Web 服务定义。
解决方案:
您的 asmx 现在应该准确反映您的 Web 服务并在未来的构建中正常更新。
I have encountered this problem and have a solution.
Cause: When you create a new "Web Service" project in Visual Studio, it automatically adds a "Service1.asmx" file to your project. You rename this file and change the class declaration inside of it, but Studio still thinks it's "Service1" wnd will only ever display the web service definition for "Service1".
Solution:
Your asmx should now accurately reflect your web service and update normally on future builds.
我今天遇到了同样的问题。这是由包含 Web 服务公开的类型定义的 GAC 版本的程序集引起的。我必须首先从全局程序集缓存中删除程序集,例如:
请务必重新启动托管 Web 服务的 Web 服务器以重新加载新版本的程序集,例如,在 IIS Express 的情况下,您可以终止以前的进程通过 PowerShell 实例:
之后,更新后的 WSDL 版本按预期显示。
I had today the very same issue. It was caused by a GACed version of the assembly that contained the type definitions exposed by the web service. I had to remove the assembly from the Global Assembly Cache first, like:
Be sure to restart the web server hosting the web service to reload the new version of the assembly, for example, in case of IIS Express, you can kill the former process instance by PowerShell:
After that, the updated WSDL version was displayed as expected.