Profiling A Web Service
jbailo
Posts: 5
I wanted to just profile the web service so I picked ASP Application, started it up, and posted a record to the web services. Then I stopped the profiler, and this popup appears (see attached bitmap). Can I profile an ASP.NET webservice using the web application profile type?
Comments
I got your attachment in the email you'd sent this morning. What you're doing is correct; you can profile a web service in the same manner as a web application by going the 'profile a web application' route and selecting the path to the ASMX webservice in the dropdown.
If you get this 'the application has not loaded the .NET Framework' error, then there is normally some configuration issue (bad ANTS installation, corrupt metabase, rights issue, missing PDB with default settings of profile all methods with source code).
I'd check first that you're not using the STOP button to stop profiling as this frees up the results and makes it appear to Profiler as if it hadn't profiled anything. Next, try using the 'profile all methods' setting and if that works, make sure that you've got a debug build.
I got it to work! I did a complete rebuild on my project and also rebooted.
I started the web service entered a value in the POST test form and then closed the form.
The results appeared immediate and it exactly pinpointed the method causing me the bottleneck!
This product is great.
I'm going to keep playing with it.
If you had changed the application configuration for the web application (creating a new application for it in IIS, or moving it to a new virtual directory), it's always a good idea to do an IISRESET from a command prompt. This commits all of the new information to the metabase and can usually sort out this type of thing without having to reboot.
I get an error message stating 'the application has not loaded the .NET Framework'. I can't find any information in the eventlog or any where else for that matter that gives me any clues to where the problem is.
Found a post in this forum explaining how to start the log in ANTS Profiler, it looks like this:
2006-04-18 10:05:22 ANTS Profiler service Start up
2006-04-18 10:06:00 StartProfilingIIS currentUserName MyDomain\MyUserName, url http://localhost/TestRedGate
2006-04-18 10:06:00 Parse IIS metabase
2006-04-18 10:06:01 Framework version determined from script map 2.0.50727.42
2006-04-18 10:06:01 InitServiceList
2006-04-18 10:06:01 StartIIS
2006-04-18 10:06:01 StopServicesInOrder
2006-04-18 10:06:12 KillNamedProcess inetinfo.exe
2006-04-18 10:06:12 StartWebService11
2006-04-18 10:06:15 WaitForPort start
2006-04-18 10:06:15 WaitForPort done
One odd thing is the 'StartWebService11', but I don't know...
Is there any resources 'technical document' or something that explain how to set up the ANTS Profiler to profile a ASP.Net 2.0 WebService?
I tried 'IISReset' and also 'aspnet_regiis.exe -r' but it didn't fix the problem, how do I find the exact cause of the error message?
I've done som more testing and if I create an ASP.Net 1.1 webservice ANTS can profile it, but not if I create a ASP.Net 2.0 webservice. The steps I take is:
1. Profile Performance
2. ASP.Net web application
3. URL to the service http://localhost/TestRedGate/Service.asmx
4. All .Net methods
5. Finish.
6. ANTS restarts the IIS.
7. "Waiting for connections" is in the status bar.
8. I run the test method.
9. Hello World is shown.
9. I choose "Take snapshot"
10a. If it's an 1.1 web service the result is shown.
10b. If it's an 2.0 web service I get:
"The web application TestRedGate/Service.asmx has not loaded the .NET Framework. Please check that TestRedGate/Service.asmx is a ASP.NET web application. Please note that accessing cached web pages will not load the .Net Framework."
When running 1.1 web service the log looks like this:
2006-04-19 09:15:34 StartProfilingIIS currentUserName MyDomain\MyUserName, url http://localhost/TestRedGate2/Service1.asmx
2006-04-19 09:15:34 Parse IIS metabase
2006-04-19 09:15:35 Framework version determined from script map 1.1.4322.573
2006-04-19 09:15:35 InitServiceList
2006-04-19 09:15:35 StartIIS
2006-04-19 09:15:35 StopServicesInOrder
2006-04-19 09:15:45 KillNamedProcess inetinfo.exe
2006-04-19 09:15:45 StartWebService11
2006-04-19 09:15:48 WaitForPort start
2006-04-19 09:15:48 WaitForPort done
I'm using Visual Studio 2003 and Visual Studio 2005. ANTS Profiler 2.6. XP SP2.
Problem Solved (Added for reference if someone get the same error):
The support helped me solve this (Many thanks to Brian Donahue) used the loged in user as the ASPNET user in the machine config change back to the ASPNET user in the machine config:
<processModel autoConfig="true" userName="machine" password="AutoGenerate" />
If you have the problem this post in the forum is great:
http://www.red-gate.com/messageboard/viewtopic.php?t=1071
Xlent Technology
Sweden