Visual Studio 2010 Professional - Problem Unit-Testing Web Services
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 folderMy 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 a开发者_运维百科s 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
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/
精彩评论