<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Colin Thomsen's Microsoft Blog : vs2010</title><link>http://blogs.msdn.com/colinth/archive/tags/vs2010/default.aspx</link><description>Tags: vs2010</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>VS2010: Attaching the Profiler to a Managed Application</title><link>http://blogs.msdn.com/colinth/archive/2009/12/05/vs2010-attaching-the-profiler-to-managed-applications.aspx</link><pubDate>Sat, 05 Dec 2009 23:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9933048</guid><dc:creator>colinth</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/colinth/comments/9933048.aspx</comments><wfw:commentRss>http://blogs.msdn.com/colinth/commentrss.aspx?PostID=9933048</wfw:commentRss><description>&lt;P&gt;Before Visual Studio 2010, in order to attach the profiler to a managed application, certain environment variables had to be set using vsperfclrenv.cmd. An example profiling session might look like this:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;vsperfclrenv /sampleon &lt;/LI&gt;
&lt;LI&gt;[Start managed application from the same command window] &lt;/LI&gt;
&lt;LI&gt;vsperfcmd /start:sample /output:myapp.vsp /attach:[pid] &lt;/LI&gt;
&lt;LI&gt;[Close application]&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;If the environment variables were not correctly set, when attempting to attach you would see this message: &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/colinth/WindowsLiveWriter/VS2010AttachingtheProfilertoManagedAppli_DEA7/old_attach_warning_2.png" mce_href="http://blogs.msdn.com/blogfiles/colinth/WindowsLiveWriter/VS2010AttachingtheProfilertoManagedAppli_DEA7/old_attach_warning_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=old_attach_warning border=0 alt=old_attach_warning src="http://blogs.msdn.com/blogfiles/colinth/WindowsLiveWriter/VS2010AttachingtheProfilertoManagedAppli_DEA7/old_attach_warning_thumb.png" width=560 height=312 mce_src="http://blogs.msdn.com/blogfiles/colinth/WindowsLiveWriter/VS2010AttachingtheProfilertoManagedAppli_DEA7/old_attach_warning_thumb.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P align=center&gt;&lt;EM&gt;The profiling environment for ConsoleApplication2 is not set up correctly. Use vsperfclrenv.cmd to setup environment variables. Continue anyway?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;The generated report would typically look something like the report below. The warning at the bottom of the page indicates the problem and the report itself would typically not be useful since no managed modules or functions would be resolved correctly.&lt;/P&gt;
&lt;P align=center&gt;&lt;A href="http://blogs.msdn.com/blogfiles/colinth/WindowsLiveWriter/VS2010AttachingtheProfilertoManagedAppli_DEA7/old_attach_badreport_2.png" mce_href="http://blogs.msdn.com/blogfiles/colinth/WindowsLiveWriter/VS2010AttachingtheProfilertoManagedAppli_DEA7/old_attach_badreport_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=old_attach_badreport border=0 alt=old_attach_badreport src="http://blogs.msdn.com/blogfiles/colinth/WindowsLiveWriter/VS2010AttachingtheProfilertoManagedAppli_DEA7/old_attach_badreport_thumb.png" width=642 height=437 mce_src="http://blogs.msdn.com/blogfiles/colinth/WindowsLiveWriter/VS2010AttachingtheProfilertoManagedAppli_DEA7/old_attach_badreport_thumb.png"&gt;&lt;/A&gt;&lt;EM&gt;&amp;nbsp; Report with 'CLRStubOrUnknownAddress and Unknown Frame(s) and the warning ‘It appears that the file was collected without properly setting the environment variables with VSPerfCLREnv.cmd. Symbols for managed binaries may not resolve’.&lt;/EM&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Fortunately the Common Language Runtime (CLR) team provided us with a new capability to attach to an already running managed application without setting any environment variables. For more detailed information take a look at &lt;A href="http://blogs.msdn.com/davbr/archive/2009/11/04/clr-v4-profiler-attach-basics-with-sample-code.aspx" mce_href="http://blogs.msdn.com/davbr/archive/2009/11/04/clr-v4-profiler-attach-basics-with-sample-code.aspx"&gt;David Broman’s post&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Caveats:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;We only support attach without environment variables for basic sampling. It will not work for Allocation or Object Lifetime data collection and Instrumentation attach is not possible. Concurrency (resource contention) attach is supported. &lt;/LI&gt;
&lt;LI&gt;The new attach mechanism only works for CLR V4-based runtimes. &lt;/LI&gt;
&lt;LI&gt;The new attach mechanism will work if your application has multiple runtimes (i.e. V2 and V4&amp;nbsp; SxS), but as noted above, you can only attach to the V4 runtime. I’ll write another post about the profiler and Side by Side (SxS). &lt;/LI&gt;
&lt;LI&gt;The old environment-variable-based attach still works, so you can still use that if you prefer.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The new procedure for attaching the profiler to a managed application in Visual Studio 2010 goes like this:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Launch your app (if it isn’t already running) &lt;/LI&gt;
&lt;LI&gt;Attach to it, either from the command-line or from the UI. &lt;/LI&gt;
&lt;LI&gt;When you’re finished, detach or close the app to generate a report.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/colinth/WindowsLiveWriter/VS2010AttachingtheProfilertoManagedAppli_DEA7/new_attach_report_2.png" mce_href="http://blogs.msdn.com/blogfiles/colinth/WindowsLiveWriter/VS2010AttachingtheProfilertoManagedAppli_DEA7/new_attach_report_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=new_attach_report border=0 alt=new_attach_report src="http://blogs.msdn.com/blogfiles/colinth/WindowsLiveWriter/VS2010AttachingtheProfilertoManagedAppli_DEA7/new_attach_report_thumb.png" width=616 height=482 mce_src="http://blogs.msdn.com/blogfiles/colinth/WindowsLiveWriter/VS2010AttachingtheProfilertoManagedAppli_DEA7/new_attach_report_thumb.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;If you want to diagnose any issues with attach, the CLR V4 runtime provides diagnostic information via the Event Log (view with Event Viewer) and the profiler also displays information there:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/colinth/WindowsLiveWriter/VS2010AttachingtheProfilertoManagedAppli_DEA7/new_attach_eventlog_2.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: block; FLOAT: none; MARGIN-LEFT: auto; BORDER-TOP: 0px; MARGIN-RIGHT: auto; BORDER-RIGHT: 0px" title=new_attach_eventlog border=0 alt=new_attach_eventlog src="http://blogs.msdn.com/blogfiles/colinth/WindowsLiveWriter/VS2010AttachingtheProfilertoManagedAppli_DEA7/new_attach_eventlog_thumb.png" width=644 height=229 mce_src="http://blogs.msdn.com/blogfiles/colinth/WindowsLiveWriter/VS2010AttachingtheProfilertoManagedAppli_DEA7/new_attach_eventlog_thumb.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P align=center&gt;&lt;EM&gt;Event Log: ‘Loading profiler. Running CLR: v4.0.21202. Using ‘Profile First’ strategy’&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;There are two .NET Runtime messages regarding the attach, the first indicating that an attach was requested and the second that the attach succeeded. The VSPERF message describes which CLR is being profiled.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9933048" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/colinth/archive/tags/profiler/default.aspx">profiler</category><category domain="http://blogs.msdn.com/colinth/archive/tags/vs2010/default.aspx">vs2010</category></item><item><title>PDC 2008 - See the Sessions</title><link>http://blogs.msdn.com/colinth/archive/2008/11/01/pdc-2008.aspx</link><pubDate>Sun, 02 Nov 2008 00:07:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9028580</guid><dc:creator>colinth</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/colinth/comments/9028580.aspx</comments><wfw:commentRss>http://blogs.msdn.com/colinth/commentrss.aspx?PostID=9028580</wfw:commentRss><description>&lt;P&gt;This year if you didn't get a chance to go to the &lt;A href="http://microsoftpdc.com/" mce_href="http://microsoftpdc.com/"&gt;Professional Developer's Conference (PDC)&lt;/A&gt;, there is still a wealth of information available to you. The most valuable resource I think are the videos of all the PDC sessions. Here are a few of the sessions that I've viewed and found most interesting:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://channel9.msdn.com/pdc2008/TL24/" mce_href="http://channel9.msdn.com/pdc2008/TL24/"&gt;Improving .NET Application Performance and Scalability&lt;/A&gt;, starring my boss Steve Carroll and Ed Glass,&amp;nbsp;this session&amp;nbsp;covers a bunch of new Visual Studio 2010 Profiler features.&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://channel9.msdn.com/pdc2008/TL59/"&gt;Visual Studio Debugger Tips &amp;amp; Tricks&lt;/A&gt;, with speaker John Cunningham who is a Microsoft&amp;nbsp;Development Manager (and Steve's boss),&amp;nbsp;covering features in Visual Studio 2008, 2008 SP1 and features to look forward to in Visual Studio 2010. Note to self 'if you ever ship without symbols, I would fire you'.&lt;/LI&gt;
&lt;LI&gt;&lt;A id=ctl00_MainPlaceHolder_TitleLink href="http://channel9.msdn.com/pdc2008/TL03/"&gt;Microsoft Visual Studio Team System: Software Diagnostics and Quality for Services&lt;/A&gt;, featuring Habib and Justin, who are&amp;nbsp;also&amp;nbsp;folks from the diagnostics team. The most exciting demo from this talk shows off the cool&amp;nbsp;new Historical Debugging feature. It also features the new Test Impact Analysis feature, which can tell you which tests you should run after changing your code.&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://channel9.msdn.com/pdc2008/PC58/" mce_href="http://channel9.msdn.com/pdc2008/PC58/"&gt;Framework Design Guidelines&lt;/A&gt;, by the guys who wrote the book of the same name, Krzysztof Cwalina and Brad Adams. If you write managed code this is a must-see session.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;If you'd like to try some of the Visual Studio 2010 features for yourself, you can &lt;A href="https://connect.microsoft.com/VisualStudio/content/content.aspx?ContentID=9790" mce_href="https://connect.microsoft.com/VisualStudio/content/content.aspx?ContentID=9790"&gt;download&amp;nbsp;the newest&amp;nbsp;CTP here&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9028580" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/colinth/archive/tags/profiler/default.aspx">profiler</category><category domain="http://blogs.msdn.com/colinth/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/colinth/archive/tags/Visual+Studio+Team+System/default.aspx">Visual Studio Team System</category><category domain="http://blogs.msdn.com/colinth/archive/tags/vs2008/default.aspx">vs2008</category><category domain="http://blogs.msdn.com/colinth/archive/tags/vs2010/default.aspx">vs2010</category></item><item><title>Visual Studio 2010</title><link>http://blogs.msdn.com/colinth/archive/2008/09/30/visual-studio-2010.aspx</link><pubDate>Tue, 30 Sep 2008 22:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8970665</guid><dc:creator>colinth</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/colinth/comments/8970665.aspx</comments><wfw:commentRss>http://blogs.msdn.com/colinth/commentrss.aspx?PostID=8970665</wfw:commentRss><description>&lt;P&gt;This week Microsoft is starting to talk about Visual Studio 2010. One of the best resources I've seen has a&amp;nbsp;bunch of videos from various Microsoft folks about some of the new features&amp;nbsp;and&amp;nbsp;what the high-level goals of&amp;nbsp;the next release of&amp;nbsp;Visual Studio are. Take a look at the &lt;A class="" href="http://channel9.msdn.com/VisualStudio/" mce_href="http://channel9.msdn.com/VisualStudio/"&gt;Channel 9 site&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There isn't much about profiling just yet, although some of the other features being developed by the diagnostics team including 'Eliminate No-Repro Bugs' and 'Test Impact Analysis' are covered. For more details about those features, you may also want to keep an eye on &lt;A class="" href="http://blogs.msdn.com/ms_joc/" mce_href="http://blogs.msdn.com/ms_joc/"&gt;John's blog&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;We'll also start talking about some of our new profiling features on the main &lt;A class="" href="http://blogs.msdn.com/profiler" mce_href="http://blogs.msdn.com/profiler"&gt;profiler blog&lt;/A&gt;. If you're going to &lt;A class="" href="http://microsoftpdc.com/Default.aspx" mce_href="http://microsoftpdc.com/Default.aspx"&gt;PDC&lt;/A&gt;, be sure to check out my boss Steve Carroll's (and Ed's) session:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A class="" href="https://sessions.microsoftpdc.com/public/sessions.aspx" mce_href="https://sessions.microsoftpdc.com/public/sessions.aspx"&gt;Improving .NET Application Performance and Scalability&lt;/A&gt;.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;You'll get to see how some of our new profiler features make finding and solving performance problems easier.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8970665" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/colinth/archive/tags/Visual+Studio+Team+System/default.aspx">Visual Studio Team System</category><category domain="http://blogs.msdn.com/colinth/archive/tags/vs2010/default.aspx">vs2010</category></item></channel></rss>