Visual Studio 2010 Professional - Problem Unit-Testing Web Services

这一生的挚爱 提交于 2019-12-24 02:33:32

问题


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:

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.

500 Error Running Visual Studio ASP.NET Unit Test

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

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?

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.

Best wishes,

Ben


回答1:


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://johnnycoder.com/blog/2008/12/16/httphandler-json-data/



来源:https://stackoverflow.com/questions/3017121/visual-studio-2010-professional-problem-unit-testing-web-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!