的Visual Studio 2010专业版 - 问题的单元测试Web服务 [英] Visual Studio 2010 Professional - Problem Unit-Testing Web Services

查看:154
本文介绍了的Visual Studio 2010专业版 - 问题的单元测试Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已经创建在Visual Studio 2010 Professional的非常简单的Web服务(ASMX),并想使用自动生成的单元测试用例。我得到的东西,似乎在这个网站很熟悉:

Have created a very simple Web Service (asmx) in Visual Studio 2010 Professional, and am trying to use the auto-generated unit test cases. I get something that seems quite familiar on this site:

该网站不能被正确配置;获取ASP.NET进程信息失败。 的http://本地主机:81 / ZFP / VSEnterpriseHelper.axd 返回一个错误:远程服务器返回了一个错误:(500)内部服务器错误

The web site could not be configured correctly; getting ASP.NET process information failed. Requesting http://localhost:81/zfp/VSEnterpriseHelper.axd return an error: The remote server returned an error: (500) Internal Server Error.

<一个href=\"http://stackoverflow.com/questions/260432/500-error-running-visual-studio-asp-net-unit-test\">http://stackoverflow.com/questions/260432/500-error-running-visual-studio-asp-net-unit-test

我曾尝试:结果
1.运行在IIS上测试,而不是ASP.NET开发服务器结果
2.添加然后去除XML片段到我的Web服务的config文件结果
3.给MACHINE \\ ASPNET帐户完全控制到本地文件夹

I have tried:
1. Running the tests on IIS rather than ASP.NET Development Server
2. Adding and then removing the XML fragment to my Web Service's .config file
3. Giving the MACHINE\ASPNET account Full control to the local folder

我现在的问题:结果
1.为什么我会被打扰这个仪器/ code覆盖DLL时,这似乎并没有被什么东西与Visual Studio 2010专业版附带?有什么办法,我可以把它关掉?结果
2.我放置节点Web.config中下 - 是正确的节点结果?
3.是否可以绑定到Web服务,而无需使用丝网的测试属性?

My current questions:
1. Why am I being bothered with this instrumentation / code coverage DLL, when this doesn't seem to be something that ships with Visual Studio 2010 Professional? Is there any way I can turn it off?
2. I'm placing the node under in Web.config - is that the correct node?
3. Is it possible to bind to a web service without using the webby test attributes?

我见过其他人建议使Web服务作为重量轻越好。我试图用jQuery / AJAX / JSON来称呼它,所以能够调试实际的Web服务将是非常有益的。

I've seen other people advising making the Web Service as light-weight as possible. I'm trying to call it with jQuery / AJAX / JSON, so being able to debug the actual web service would be really helpful.

最良好的祝愿,

推荐答案

对不起,因为我不知道把我的头顶部,但如果你想使用AJAX / JSON消耗的服务没有直接回答你的问题,你正在建设,你应该直接写一个ashx的处理程序,并返回JSON数据可以直接作为本地JavaScript读取。

Sorry to not answer your questions directly because I dont know off the top of my head, but if you want to use AJAX / JSON to consume a service that you are building, you should write a .ashx handler and return JSON data directly that can be read directly as native javascript.

的http://约翰尼codeR .COM /博客/ 2008/12/16 / HttpHandler的JSON的数据/

这篇关于的Visual Studio 2010专业版 - 问题的单元测试Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆