Visual Studio >> Debug menu >> Start performance analysis doesn't work with a HttpHandler because it cannot be run by itself. The error is something like this:
getting asp.net information failed. 'http://localhost/myprojrct/VSEnterpriseHelper.axd' returned error (500 internal server error)
Also attaching to w3wp.exe via profiler only profiles CPU.
How is it possible to run performance analysis on a HttpHandler asp.net project (I don't use ashx file and there's no asp.net page, just a class which implements IHttpHandler)
The simple answer is to move your processing logic out of your IHttpHandler implementation and into a class that can be tested with Profiler. Keep your footprint for the handler as small as possible.
Related
I have a WebAPI method for the POST operation. I wanted to do load testing with the same using Visual Studio 2013. Per my knowledge, what I did is, added a load test and called the unittest method written to the above POST webapi method and added some performance counters to it. Is the the only option or do we have any other efficient way to do the same.
Thanks,
Srikanth
Have anybody used EFProf (http://www.hibernatingrhinos.com/products/EFProf) with IdeaBlade?
I have problems with start working with that. There is the connection between apps (because I see name of the app in toolbar) but no queries are presented.
Any ideas?
In an n-tier or Silverlight application make sure that you call the EFProf initialization on the server. The application_start method in the global.asax is a good place for this.
I am looking for a way to batch requests to the server. I found a post by Brad Wilson outlining how to make a batch handler using a message hanlder http://bradwilson.typepad.com/blog/2012/06/batching-handler-for-web-api.html#more but I wasn't able to get this working.
first I had compile errors because webapi did not understand "route-specific endpoint handler" like Brad's example used. there were also problems with the media type and/or formatter (can't remember which). My next attempt was to make a batch controller. so instead of a batch handler I had a batch controller. I almost has this working except when I used the MessageHandlerInvoker to call the individual commands I got exceptions about the additional handlers I have regsstered (1 for logging request/response and another to mimic user authentication).
At that point I stopped and reverted back to individual requests, not ideal, but it works.
My environment:
.net 4.0
VS 2010
mvc 4 front end (calls webapi)
webapi as a service tier
Has anyone else had any success with batched messages and webapi?
To be able to use per-route handlers you need ASP.NET Web API RTM which was only released yesterday (at the time when Brad wrote the article, it would only work with nightly MyGet feed builds or against Codeplex source).
You can get entire MVC4 RTM here or simply off Nuget.
I have a unit test that behaves differently depending on parameters passed. Does VS 2010 MS Testing framework have a facility to call the same test with different parameters.
I am looking for something like this:
[TestRun(False)]
[TestRun(True)]
[TestMethod]
public void FooTest(bool a)
{
RunTest(a);
}
I have no idea why Micosoft's decided not to include this feature in their unit testing framework, whenever I search for it I find reference to the DataSource attribute that enable loading data from external resource (XML file, data base etc.)
If you do not want to use and external data source then you have two choices:
Add RowTest support using MSTest extensability framework - explained here
I wrote in my blog how to use PostSharp to create the external data source from the test attributes.
If you're already using VS2010 I suggest you go with the first option - there is even a full working code at Microsoft's code gallery.
The following page tells how to achieve the same with MSTest data-driven testing capabilities: http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.dataaccessmethod.aspx
I'm trying to debug an issue which may be due to a delay in running some cleaup code that's in an OnEndPage method.
I have a LoginPage class (in VB6) which is normally created directly by an ASP page. But in another case, an ASP page creates another VB object, which then does approximately this
Set oLoginPage = Server.CreateObject("LoginPage")
Call oLoginPage.DoLogout;
Set oLoginPage = Nothing
Some crucial cleanup is done in the OnEndPage method of LoginPage class, and it looks like this happens asynchronously, and with enough of a lag to cause problems.
Can anyone confirm that OnEndPage runs asynchronously, and might lag a bit? I've not been able to find any mention of this in documentation, just that objects are garbage collected "as soon as the reference count goes to zero." But that doesn't seem to be what's happening in my code.
This is a VB6 application called by an ASP page. It needs to run on multiple versions of IIS from 5.0 upwards.
Thanks.
O.K., it's simpler than I thought. Apparently the OnEndPage method is run by ASP after all the rest of the stuff on the page is finished. This applies even to VB objects created indirectly (that is, created by VB objects that were created by the ASP page), as long as they are created using Server.CreateObject().