简体   繁体   English

代码分析ASP.NET MVC2应用程序

[英]Code Profiling ASP.NET MVC2 applications

The thread here seems close: Profiling ASP.NET websites with EQATEC Profiler 这里的线程似乎很接近: 使用EQATEC Profiler分析ASP.NET网站

However, in the free version of Equatec I downloaded today there is no checkboxes for ASP.NET, and ordinary web. 但是,在我今天下载的免费版Equatec中,没有ASP.NET和普通网络的复选框。 I have pointed the App path to my bin directory in my project folder as well as started up the localhost hosting for my application via Visual Studio. 我已将App路径指向我的项目文件夹中的bin目录,并通过Visual Studio启动了我的应用程序的localhost托管。

I am open to other free tools as well. 我也对其他免费工具持开放态度。 I am just looking for someway to profile the code as to optimize some reflection we are using. 我只是想找个方法来分析代码,以优化我们正在使用的一些反射。

I am using the professional edition so unfortunantly do not have access to MS Code Profiling. 我正在使用专业版,所以不幸的是无法访问MS Code Profiling。

I am looking to do performance profiling at this point. 我希望在这一点上进行性能分析。

Is the free version of Equatec capable of doing ASP.NET applications? Equatec的免费版能否支持ASP.NET应用程序?

Is there a free profiler (I realize this has been asked before, and little seems to have surfaced but paid apps, but might as well ask)? 有没有一个免费的探查器(我意识到这之前已被问过,似乎很少有人浮出水面但付费的应用程序,但不妨问一下)?

Is MVC a special thing to look for in a profiler? MVC是一个在分析器中寻找的特殊事物吗?

Comprehensive profiling tools still seem to be quite expensive. 全面的分析工具似乎仍然非常昂贵。 I like the dotTrace family, but they're not free. 我喜欢dotTrace家族,但他们并不自由。

You haven't specified what kind of profiling you want to do. 您尚未指定要执行的分析。 Are you trying to understand more about the memory usage of your application, or CPU usage? 您是否尝试了解有关应用程序的内存使用情况或CPU使用情况的更多信息?

There is nothing special about MVC applications when it comes to profiling. 在分析时,MVC应用程序没有什么特别之处。 You will need a profiler that's capable of launching ASP.NET. 您将需要一个能够启动ASP.NET的分析器。 Beyond that, MVC is just a regular bunch of class libraries. 除此之外,MVC只是一组常规的类库。

Have you tried the free CLR Profiler ? 你试过免费的CLR Profiler吗? It handles ASP.NET and will show both memory and some method call activity. 它处理ASP.NET并显示内存和一些方法调用活动。 It's not as comprehensive as say dotTrace, but it is a great free alternative if you're starting out. 它不像dotTrace那么全面,但如果你刚开始的话,它是一个很好的免费选择。

The guide is actually not out of date: the few steps described in the stackoverflow duplicate question (last edited April 8th) still describes best how you should profile ASP.NET apps. 该指南实际上并不过时: stackoverflow重复问题 (最后编辑于4月8日)中描述的几个步骤仍然描述了如何配置ASP.NET应用程序的最佳方法。 Note that you should look at the accepted answer, the one with currently 16 upvotes. 请注意,您应该查看已接受的答案,目前有16个赞成票。

After you've build the instrumented app the important thing to note in the stackoverflow-answer above is step 3: "load your app" . 在构建了已检测的应用程序之后,上面的stackoverflow-answer中需要注意的重要事项是步骤3: “加载您的应用程序” It means that you should cause your app to be loaded and is the only step the profiler can't do automatically for ASP.NET apps. 这意味着应该加载您的应用程序,这是分析器无法自动为ASP.NET应用程序执行的唯一步骤。

You typically load the app simply by navigating to it in a browser so you simply need to do that after the build-step. 您通常只需在浏览器中导航即可加载应用程序,因此您只需在构建步骤后执行此操作即可。 When your (instrumented) code is activated the profiling part of it will spring into life and connect to the profiler and then you can take snapshots. 当您的(已检测的)代码被激活时,它的分析部分将会生动并连接到分析器,然后您可以拍摄快照。

Note that ASP.NET doesn't need a main entry point. 请注意,ASP.NET不需要主入口点。 That's just an added convenience for automatically taking snapshots for real executables that has a Main method. 这只是为具有Main方法的真实可执行文件自动拍摄快照的一个额外的便利。

You just need a .NET profiler. 你只需要一个.NET分析器。

Profiling WebForms, MVC, SharePoint, Sitecore, Ektron, Sitefinity, or any other product that runs on .NET doesn't change that. 分析WebForms,MVC,SharePoint,Sitecore,Ektron,Sitefinity或在.NET上运行的任何其他产品都不会改变它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM