tag:blogger.com,1999:blog-72524567671511178372023-11-16T16:17:31.457+09:00Shou Takenaka's DevLogxianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-7252456767151117837.post-48220753340516320852011-12-11T21:26:00.001+09:002011-12-11T21:26:32.153+09:00FxCop Integrator 3.0.0 Preview 1 Released<p>In Dec 11 2011, I released FxCop Integrator 3.0.0 Preview 1.</p> <p> </p> <p>This release can be installed in VS11 Developer Preview.</p> <p>So you can use same features as FxCop Integrator 2.0.0 RTW on VS11 Develop Preview.</p> <p> </p> <p>FxCop Integrator 3.0.0 Preview 1 is available <a title="FxCop Integrator 3.0.0 Preview 1" href="http://bit.ly/ufuiXm" target="_blank">here</a>.</p> xianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.com0tag:blogger.com,1999:blog-7252456767151117837.post-56679287047455330812011-12-05T22:00:00.001+09:002011-12-05T22:02:01.824+09:00FxCop Integrator 2.0.0 RTW Released<p>In Dec 4 2011, I released FxCop Integrator 2.0.0 RTW.</p> <p> </p> <p>This release contains following new features:</p> <ul> <li>Supported calculating code metrics with Code Metrics PowerTool. <li>Provided MSBuild tasks. <li>Supported to filter out auto-generated code from code analysis result. <li>Supported exporting report of code analysis result. <li>Supported multi-project analysis. <li>Supported file level analysis. <li>Added the feature to let developers more easily add a "SuppressMessage" tag into the code.</li></ul> <p>And also it contains many improvements and bug fixes.</p> <p> </p> <p>FxCop Integrator 2.0.0 RTW is available <a title="Download FxCop Integrator 2.0.0 RTW" href="http://bit.ly/tNUD37" target="_blank">here</a>.</p> xianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.com0tag:blogger.com,1999:blog-7252456767151117837.post-87950529279778880702011-11-28T23:23:00.001+09:002011-11-28T23:28:17.514+09:00FxCop Integrator 2.0.0 RC Released<p>In Nov 27 2011, I released FxCop Integrator 2.0.0 RC. You can download it from <a href="http://vs2010fxcopext.codeplex.com/releases/view/77644" target="_blank">CodePlex project site</a>.</p> <p>The 2.0.0 RC contains following new features.</p> <p> </p> <p> </p> <p><strong>Provides MSBuild tasks</strong></p> <p>I implemented MSBuild custom tasks to execute code inspection and code metrics calculation. These MSBuild tasks work the same as FxCop Integrator’s on-demand execution.</p> <p>You can install MSBuild tasks with the msi installer not VSIX. So, you can install them to the machine that doesn’t have Visual Studio (e.g. CI server).</p> <p> </p> <p>The MSBuild tasks installer creates %PROGRAMFILES%\MSBuild\FxCop Integrator\FxCopIntegrator.targets. When you add</p> <blockquote> <p><Import Project="$(PROGRAMFILES)\MSBuild\FxCop Integrator\FxCopIntegrator.targets" /></p></blockquote> <p>to the project file and specify</p> <blockquote> <p>/p:FxCopCmdPath=<em>”the path of FxCopCmd.exe”</em> /p:EnableCodeInspectionOnBuild=true</p></blockquote> <p>as MSBuild command line parameter, MSBuild executes code inspection after build.</p> <p>FYI, when you specify following command line parameter, MSBuild executes code metrics calculation after build.</p> <blockquote> <p>/p:MetricsPath=<em>”the path of Metrics.exe”</em> /p:EnableCodeMetricsCalculationOnBuild=true</p></blockquote> <p> </p> <p>The internal specification of the “Code Analysis on Build” feature was changed.</p> <p>In 2.0.0 Beta 2 or before, the specification of this feature is</p> <ol> <li>When the FxCop Integrator extension is loaded, it generates “CodeAnalysis.exe” that can analyze code the same as FxCop Integrator’s on-demand execution.</li> <li>When user enable '”Code Analysis on Build”, FxCop Integrator changes a project file to add the Exec MSBuild task to execute CodeAnalysis.exe into the “AfterBuild” target.</li></ol> <p>But 2.0.0 RC or later,</p> <ol> <li>When user install FxCop Integrator MSBuild tasks and enable “Code Inspection on Build”, FxCop Integrator changes a project file to import the above targets file and to add the EnableCodeInspectionOnBuild property.</li></ol> <p>For backward compatibility, you can still use the old style “Code Analysis on Build” feature, but it will be deprecated in the future release.</p> <p> </p> <p> </p> <p><strong>Warning Filtering Feature</strong></p> <p>I implemented the warning filtering feature to filter out warnings against the code that is defined in a designer file or an auto-generated file.</p> <p>You can define filtering patterns with the code analysis configuration editor.</p> <p> </p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6er35dIney7RLXL76yDR4HxE1n_8kjPakFkJLUl7tNNm-qErYY43s-k-qjz1qg_6mZvaoJ5iV4egm3wNNiDCBAIozDgLz2-3XZy07k8AaIY4_lpbbtH-rbShO0Lz3LmgWroIBIMnHY5M/s1600-h/image%25255B4%25255D.png"><img style="background-image: none; border-right-width: 0px; margin: 0px 0px 0px 50px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFr4aHhC2_2ndDQQ6Sn82zDkgjTnkuMdQ0JSwAhDFKKjWlDTbDjbCxn9NHSoa4NLfMNTA0l1TWz-wTk_caLRRGJgti-J0gir87tPo7nFMd6uPCEz1hOJ9UmM1eFR96W6mUwHNKuRHV9ZU//?imgmax=800" width="344" height="382"></a></p> <p> </p> <p>By default, FxCop Integrator defines filtering patterns to filter out designer code (e.g. *.Designer.cs, etc) and auto-generated code (e.g. *.generated.cs, *.g.cs, etc).</p> xianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.com0tag:blogger.com,1999:blog-7252456767151117837.post-30613358990175492102011-11-13T11:03:00.001+09:002011-11-13T11:50:33.257+09:00FxCop Integrator 2.0.0 Beta 2 Released<p>In Nov 11 2011, I released FxCop Integrator 2.0.0 Beta 2. You can download it from <a href="http://vs2010fxcopext.codeplex.com/releases/view/76647" target="_blank">CodePlex project site</a>.</p> <p>FxCop Integrator is a Visual Studio 2010 extension that integrates FxCop to VS2010 and makes it easy to execute FxCop like VS2010 Premium/Ultimate. It also supports to filter code analysis results and shows the FxCop rule detail.</p> <p>Version 2.0.0 supports to execute Metrics.exe (Visual Studio Code Metrics Power Tools 10.0) and provides some new features.</p> <p> </p> <p> </p> <p><strong>Visual Studio Code Metrics Power Tools 10.0 Integration</strong></p> <p>FxCop Integrator 2.0.0 supports to integrate Visual Studio Code Metrics Power Tools 10.0. You can easily execute Metrics.exe on the Solution Explorer.</p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBuXpVEbr4xtqMo32GgK7t2RVYbuWaqr-6ZXo_dEsH7vpIDwnyb6xgEsEBZXIqOOx8PNE5BQ_R-AARzUpa7kzbVG62deJVh4Tw5WLf0fqYrckVVXj2MpzJSGA_p-cKt9Hcs4V0va9euXk/s1600-h/support_code_metrics_thumb%25255B7%25255D%25255B2%25255D.png"><img style="background-image: none; border-right-width: 0px; margin: 0px 0px 0px 50px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="support_code_metrics_thumb[7]" border="0" alt="support_code_metrics_thumb[7]" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj85xMqJaWNGdzE1NeIH68t0054Pb8YxX_ERZp1cdIBqjOofhGZrJQGPCWrndJK8BQUZ3Nc12iAlkltfMzuPTBvaxgYQv9m8_PBO1JeKneXxzGCi-5JefMPn3TI-NpfMPQmuAdB4wVm7d8//?imgmax=800" width="404" height="147"></a></p> <p> </p> <p>When you execute code metrics calculation, FxCop Integrator shows calculation result as below.</p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6p_grWKEKwVrm8q7ny0GxqfJbsMMetdhQcFstYlynKX0Nji31zZB9hLOxggy14MEQz805NMyO8rRe97UexgbVA7rkZM5zffJoD0Ltf0_AWSEsGTw3Ilv9_SRiTlLHWlvAmLBJb74C3ac/s1600-h/image_thumb%25255B22%25255D%25255B2%25255D.png"><img style="background-image: none; border-right-width: 0px; margin: 0px 0px 0px 50px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image_thumb[22]" border="0" alt="image_thumb[22]" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBqVtUGtMeYccHpbJ938MmVkb7_OwndAe8NRpsflCYUmJVsSK-RX_7koy97zv5Ph8I5nD6MLKe-giu0Ymb6rbmAIMSqpXV1N2-pJ5heV212YOpu2WShUT-IjEAnHuTd5_2l01V3WaNXkI//?imgmax=800" width="554" height="203"></a></p> <p> </p> <p>Because FxCop Integrator supports FxCop and Metrics, I added some menus for executing code analysis.</p> <ul> <li><strong>[Code Analysis]</strong> : Execute both FxCop and Metrics. <li><strong>[More Tasks…] > [Inspect XXX]</strong> : Execute FxCop only. <li><strong>[More Tasks…] > [Calculate Metrics]</strong> : Execute Metrics only.</li></ul> <p> </p> <p>But if you don’t want to use Metrics, you can change the [Code Analysis] menu behavior from option page.</p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHnqaOMI2K9rCWsB0HNK7tb6GLJf5EczrybqzT2TqCq1m4STn9UBs7ycG69loCct7dVwK5HXnkFlyi-t9xDA5-8v6jGthKZYo9scVTzc8Wsy2aMkfJpyk7j0Ccg-_r4Ahw5KcM340junw/s1600-h/image_thumb%25255B7%25255D%25255B2%25255D.png"><img style="background-image: none; border-right-width: 0px; margin: 0px 0px 0px 50px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image_thumb[7]" border="0" alt="image_thumb[7]" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJxAp1-KP3WcXFh0smQ0xxszv2kUlxRAHUARws_BN2gB11aScc1CeLGYCTpoS7JvM_lbtJ3p1dTOd7iN1CMhtWRRhl8RQmKYvZwG3m2g4iE-KICHw44AZzyhIlhBTGdPfbjJx-oJkTCeY//?imgmax=800" width="484" height="286"></a></p> <p> </p> <p> </p> <p><strong>Multi-Project Analysis, File Level Analysis</strong></p> <p>FxCop Integrator 1.X only supported to analyze all projects in a solution or a single project. But 2.0.0 supports to analyze selected multi-project.</p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwNCneR6waqtEqlDJxicKgupvA2uQ-icLfZ2IMjbp-wFnVD3SBZiteDxgTjJhVP5JsSlk3LG63BFLoMNOZeR4Dlnufz61egY40AHiKem2M2Nqksk2FrxgcxC5kPsr8FNTuaXWuTy2oG_M/s1600-h/image_thumb%25255B10%25255D%25255B2%25255D.png"><img style="background-image: none; border-right-width: 0px; margin: 0px 0px 0px 50px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image_thumb[10]" border="0" alt="image_thumb[10]" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcm7GYNDDn2byp_SPRn3rYQfqoOyJfDHY75p8w6US8vcGt3Yjn32yCtxZ9gytfqq1OpIGmA8gGYRiKSgtjpV4fMpjvJeOL9OkX-qaO9ejvgKc6bavV0mt3KxiDX9vWiRmqZRmNHMuKX4Y//?imgmax=800" width="364" height="161"></a></p> <p> </p> <p>Also you can analyze only some types that are defined in the specified file. This feature can be used when the language of source code is C# or VB.NET. And, this doesn’t support code metrics calculation.</p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcAbm6jiNiq0zmi07ZLUXoAiX8HODxvXKV_T7KepSFvC7mm3kM3e7yhY9NGHiGQR60swZjbYnmB_N_WY6DyBCgotHBiHOY_2mXLxboKcN6BybBRkFnpBQS8CtLc-_d7zjyXiRUYwZT838/s1600-h/image_thumb%25255B13%25255D%25255B2%25255D.png"><img style="background-image: none; border-right-width: 0px; margin: 0px 0px 0px 50px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image_thumb[13]" border="0" alt="image_thumb[13]" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT_GxucXW2ycLaMr-8bpL3vsVRHQnjX-3KD-Mt3ismtyovmgmCmAFkdRqtgR-osZptGZRSSXXCfL_B3hr8maShkxPCpflMtXs6SNvSWFbyQIHoIr1f2CBPYWtA2cmk7ZXyqlHL-TqqiQs//?imgmax=800" width="304" height="185"></a></p> <p> </p> <p> </p> <p><strong>Message Suppression</strong></p> <p>The Suppress Message is added in the Rule Detail window to let developers more easily add a “SuppressMessage” attribute into the code.</p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzN8pAQ4N0cr626oiKsQZ2gk6XHwfP0ifqDzUbuxV42edJpGvRlXpfP8-nJX6_zAPmydZeNImQxNdgKbI-qbXJRwMm3A2sYLHwj6-BhAf0MlgwFga9OpKYP1ffMi0fTzcDEg1pZneTg8I/s1600-h/image_thumb%25255B16%25255D%25255B2%25255D.png"><img style="background-image: none; border-right-width: 0px; margin: 0px 0px 0px 50px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image_thumb[16]" border="0" alt="image_thumb[16]" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUrO5_-tG9clVrlyO2XldkepjPTZ6ajia6caLzqa8eTw2l20SCIkzyLZvITjkp66lncyiTgBMTh80RtZuT0parBzBxUQ5JflQMFwMuScniNvQkzKxF3fG0Cj4OADc2MzZcD-bVlrBRq48//?imgmax=800" width="224" height="392"></a></p> <p><strong></strong> </p> <p><strong></strong> </p> <p><strong>Export Code Analysis Result</strong></p> <p>The [Export] menu is added in the Code Inspection Result window and the Code Metrics Calculation Result window. You can export code analysis result as CSV.</p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJsqsRFYgj49SObcrA9oVwwolNEm8G_5wT21kQ_pgyK8bVdsutWmVDFNPKwxi_1GWlaawzYO3LGjmJ4Wq-94nv9Un28o_Zaa9p0RF5UKuLicOqIRX3riZlRUkFwGoAiabT_2TJRy7gtLU/s1600-h/image_thumb%25255B19%25255D%25255B2%25255D.png"><img style="background-image: none; border-right-width: 0px; margin: 0px 0px 0px 50px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image_thumb[19]" border="0" alt="image_thumb[19]" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtz6m5WQPPYkOxcjBy-vfZfEe59fh9GvP_Me3VOiI_3R8tftXd7z-PoxhqfEg8VPElN3key1CSFQyZa4hhKgGrKQggTcoZ9KQfoaONcE26Y_MmPWcJftpO7xhzRMxaKGMROgu7rT0pEj8//?imgmax=800" width="379" height="139"></a></p> <p><strong></strong> </p> <p><strong></strong> </p> <p>And more improvements and bug fixes.</p> <p> </p> <p>I’ll release FxCop Integrator 2.0.0 RTW in late November or early December.</p> xianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.com0tag:blogger.com,1999:blog-7252456767151117837.post-47530659242858395622011-05-08T01:32:00.001+09:002011-05-08T01:35:45.548+09:00FxCop Integrator 1.4.0 Planned Feature SetAfter I released FxCop Integrator 1.3.0 on Apr 24 2011, I received some bug reports. The cause of them is the "Code Analysis on Build" feature that is implemented in 1.3.0. I don't know why, but event handlers of Visual Studio build events, are used by this feature, don't work in VS2010 SP1. So I immediately released 1.3.0p1 that is disabled this feature.<br />
<br />
<b>In 1.4.0, I'll enable the "Code Analysis on Build" feature</b> again. I plan to implement it with a different way, thus it should be able to be used on VS2010 SP1.<br />
<br />
<br />
I also plan to implement following features,<br />
<br />
<b>Enable customization of data grid of code analysis result window</b>. I'll enable data grid of code analysis result window to sort, show/hide columns and persistent column settings.<br />
<br />
<b>More useful error report window</b>. I'll add the error report window that makes it easy to send feedback.<br />
<br />
<br />
I'll release FxCop Integrator 1.4.0 in May 22 2011.xianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.com0tag:blogger.com,1999:blog-7252456767151117837.post-29603172288865750302011-05-05T18:04:00.000+09:002011-05-05T18:04:29.405+09:00FxCop Integrator 1.3.0p1 ReleasedI've released <a href="http://bit.ly/joVOUv">FxCop Integrator 1.3.0p1</a>.<br />
<br />
In this release, I temporarily disabled the "Code Analysis on Build" feature that is implemented in ver1.3.0, because I realized that events of EnvDTE.BuildEventsClass don't raised on VS2010 SP1(*). "Code Analysis on Build" depends to their events, so I had no choice but to disable it. I'll enable this feature in the future release if I can find out a workaround.<br />
This version is also improved performance and fixed some bugs.<br />
<br />
<br />
* I sent a feedback about this problem to <a href="http://bit.ly/jmEDMq">Microsoft Connect</a>.xianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.com0tag:blogger.com,1999:blog-7252456767151117837.post-84530437835805009302011-05-04T11:11:00.002+09:002011-05-04T11:37:19.643+09:00How to store/restore UI state of Visual Studio tool window pane<br />
A tool window pane of Visual Studio is a class that inherits from Microsoft.VisualStudio.Shell.ToolWindowPane. We can create a sub classes of this to add custom a tool window pane to our VSPackage.<br />
<br />
ToolWindowPane class has overridable SaveUIState and LoadUIState methods. It seems that we can use them to store/restore UI state of tool window pane, but thier methods are never called. According to this thread, it looks like their methods are only called on document windows not tool window panes.<br />
<br />
Instead of SaveUIState and LoadUIState, we can use OnCreate and OnClose methods. Just like the name implies, OnCreate is called when a tool window pane is created, and OnClose is called when a tool window pane is closed. So if we override them, we can implement the feature to store/restore UI state.<br />
<br />
For example, we can store UI state to xml file and restore UI state from xml file like this.<br />
<br />
<pre class='brush: csharp'>
public CustomToolWindowPane : ToolWindowPane
{
private string path;
public CustomToolWindowPane()
{
...
var directory = Path.GetDirectoryName(typeof(CustomToolWindowPane).Assembly.Location);
path = Path.Combine(directory, "uistate.xml");
}
protected override void OnCreate()
{
using (var stream = File.Open(path, FileMode.Open))
{
var serializer = new XmlSerializer(typeof(UIState));
var state = (UIState)serializer.Deserialize(stream);
ApplyUIState(state);
}
}
private void ApplyUIState(UIState state)
{
...
}
protected override void OnClose()
{
var state = BuildUpUIState();
using (var stream = File.Open(path, FileMode.Create))
{
var serializer = new XmlSerializer(typeof(UIState));
serializer.Serialize(stream, state);
}
}
private UIState BuildUpUIState()
{
...
}
public class UIState
{
...
}
}
</pre>xianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.com0tag:blogger.com,1999:blog-7252456767151117837.post-32644410059194104862011-04-25T00:54:00.000+09:002011-04-25T00:54:40.251+09:00FxCop Integrator 1.3.0 ReleasedI've just released FxCop Integrator 1.3.0 in Apr 24 2011. This version contains new features: "Code Analysis on Build" and "FxCop Dictionary Support". I also fixed some bugs.<br />
<br />
FxCop Integrator 1.3.0 available <a href="http://bit.ly/gRwyfR">here</a>. Please try it and send me to feedback.xianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.com0tag:blogger.com,1999:blog-7252456767151117837.post-44529022585148393002011-04-04T22:15:00.000+09:002011-04-04T22:15:27.643+09:00FxCop Integrator 1.3.0 Planned Feature Set<br />
After I released FxCop Integrator 1.2.0, I got some bug reports and suggestion of new features from users. I'll fix and implement them as possible.<br />
<br />
The following are planned features of FxCop Integrator 1.3.0.<br />
<br />
<br />
<b><u>Code Analysis on Build</u></b><br />
This is like "Code Analysis on Build" of Visual Studio 2010 Ultimate or Premium.<br />
This feature allow you to perform code analysis automatically when you build a project. And you can select whether or not FxCop Integrator should break build if code analysis result has error.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2y5Nuc9GwNplAbH8HixFrgUWdk7uEv3JBZOrrGaoKogm8E8JWsoPLGr27VQt5xNGSeJ3U_OSQsOT5SJMb-eKqZbVo8JkIl5XvaJQO-nGFd75BybOnevloUXr_1ghoG3xa_6_bCYaz_Lk/s1600/configurationeditor.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2y5Nuc9GwNplAbH8HixFrgUWdk7uEv3JBZOrrGaoKogm8E8JWsoPLGr27VQt5xNGSeJ3U_OSQsOT5SJMb-eKqZbVo8JkIl5XvaJQO-nGFd75BybOnevloUXr_1ghoG3xa_6_bCYaz_Lk/s320/configurationeditor.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Code Analysis Configuration Editor of ver1.3.0</td></tr>
</tbody></table>
<br />
<br />
<b><u>FxCop Dictionary Support</u></b><br />
FxCop contains some naming rules and supports "Custom Dictionary" to allow you to customize them. Ver1.3.0 will support to pass a dictionary file to FxCop. In addition, ver1.3.0 will contain FxCop dictionary editor.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhthtpZYMA2NhZPYswVrXoGMtbWYPvliLpDMYPXDVLLhScLbykeaBZ9UKP3lJOacBXKGZ_hCpqo6wBfrs8v20hZoah4IPQ07y8-Nmdp6jwQsuy8kmW-WvnWNbw8wK_F6_uke-onDsbIIX4/s1600/dictionaryeditor.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="178" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhthtpZYMA2NhZPYswVrXoGMtbWYPvliLpDMYPXDVLLhScLbykeaBZ9UKP3lJOacBXKGZ_hCpqo6wBfrs8v20hZoah4IPQ07y8-Nmdp6jwQsuy8kmW-WvnWNbw8wK_F6_uke-onDsbIIX4/s320/dictionaryeditor.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">FxCop Dictionary Editor of ver1.3.0</td></tr>
</tbody></table>
<br />
<br />
<b><u>Silverlight Project Support</u></b><br />
Ver1.2.0 couldn't analyze a Silverlight project. Because silverlight assemblies are located in <i>%PROGRAMFILES%\Reference Assemblies\Microsoft\Framework\Silverlight\vx.x</i> not GAC and FxCop Integrator cound't specify reference assemblies to FxCop.<br />
This problem will be solved in ver1.3.0.<br />
<br />
<br />
<b><u>FxCop 1.36 Support</u></b><br />
Now I'm implementing the parser of FxCop 1.36 analysis report. The next version of FxCop Integrator will support to analyze with FxCop 1.36.<br />
<br />
<br />
<b><u>Custom Ruleset Selection</u></b><br />
The code analysis configuration editor of ver1.3.0 will support to select a ruleset file that is located in any folder.<br />
<br />xianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.com0tag:blogger.com,1999:blog-7252456767151117837.post-43099135510228118612011-02-26T00:39:00.003+09:002011-02-26T01:03:03.440+09:00How to test behavior of a killed Android application<b><u>Background</u></b><br />
The Android application doesn't always continue to run in same process. When an user run your application and others same time, and one of other applications requires more memory, then there is a possibility that the process of your application is killed. Later, your application are started in a new process and activities are recreated when the user re-launch your application.<br />
But the user doesn't know your application process was killed. So, your application should be shown the same as before. To resume the state of last time, you need to implement and test storing/restoring application data.<br />
<br />
But how can we easily test that situation?<br />
<br />
This post explains how to test behavior of a killed Android application with Android emulator.<br />
<br />
<br />
<b><u>Testing behavior of a killed Android application</u></b><br />
The most easy way to test, launch your application, show any activity and rotate emulator with <b>Ctrl+F11</b> or <b>Ctrl+F12</b>.<br />
When an Android device is rotated, activities are recreated. This is the same situation as Android application is killed and restartd.<br />
<br />
But, if you prevent rotation your activity, you can't use above technique.<br />
In this case, first, launch your application, show any activity and back to home with Home button or launch another application.<br />
<br />
Next, kill your application process with <b>ddms</b> or <b>adb</b> (that is the same situation as Android kills your application to collect memory).<br />
If you want to use ddms (or Eclipse ddms perspective), select process which you want to kill and push stop button.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXe7vWCLHZ2Tl7mwzsR_tE6meMrjVxdLkZ-9TKCG_JnsR_ZxjlshRCFm-8pczhAgCs_7Qi3YLrsv_HqNAQHEDyzKYirVSagmcADxPSdincjXOoYeseoysRBPM0D0dCiyJXQaafohouVVA/s1600/ddms_kill_process.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXe7vWCLHZ2Tl7mwzsR_tE6meMrjVxdLkZ-9TKCG_JnsR_ZxjlshRCFm-8pczhAgCs_7Qi3YLrsv_HqNAQHEDyzKYirVSagmcADxPSdincjXOoYeseoysRBPM0D0dCiyJXQaafohouVVA/s320/ddms_kill_process.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Kill any process with DDMS perspective of Eclipse</td></tr>
</tbody></table>
<br />
If you want to use adb,<br />
<ol>
<li>launch "adb shell".</li>
<li>find PID of the process which you want to kill with "ps"</li>
<li>execute "kill PID"</li>
</ol>
<br />
Finally, re-launch your application. Android starts it in new process and recreate your activity.<br />
<div>
<br /></div>xianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.com0tag:blogger.com,1999:blog-7252456767151117837.post-47862676283805586842011-01-24T21:53:00.001+09:002011-01-25T23:03:10.882+09:00How To Use VS2010 Code Analysis Rules and Localization Resources in FxCop 10.0I learned VS2010 Pro contains static code analysis rules and the stand-alone FxCop 10.0 can use them (thanks <a href="http://stackoverflow.com/users/13188/pedro">@Pedro</a>).<br />
<br />
By default, VS2010 code analysis rules were installed in <i>%PROGRAMFILES%\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\Rules</i>. If you copy assemblies in this directory to FxCop Rules directory <i>(%PROGRAMFILES%\Microsoft FxCop 10.0\Rules</i> by default), FxCop can detect VS2010 code analysis rules.<br />
<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
But, what good is it?</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
The stand-alone FxCop doesn't contain Maintainability and Reliability rules. Thus, this technique allows you to use them in FxCop.</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
Additionally, localization resources are also contained in %<i>PROGRAMFILES%\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop</i>. For example, VS2010 Pro Japanese Edition has <i>ja </i>directory in the above directory. If you copy this one to FxCop Rules directory, you can localize rule list of FxCop GUI and FxCopCmd output messages.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFfjeJoO_dTDFfcu2QdY9j14y46cMTd4R4Vt-mwrpzF7o0qjANr0Ny4PMoRqXFQmMPazWthxtgqQFsr-w0j5Tz8z_sEKC59a9Igj0rij3aDzvDfJ5q4oCwf-UKz_G9Z9Y3blu00bPi0_4/s1600/fxcop_localized.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="489" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFfjeJoO_dTDFfcu2QdY9j14y46cMTd4R4Vt-mwrpzF7o0qjANr0Ny4PMoRqXFQmMPazWthxtgqQFsr-w0j5Tz8z_sEKC59a9Igj0rij3aDzvDfJ5q4oCwf-UKz_G9Z9Y3blu00bPi0_4/s640/fxcop_localized.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Localized FxCop GUI</td></tr>
</tbody></table>
<br />
<br /></div>xianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.com0tag:blogger.com,1999:blog-7252456767151117837.post-2178994826584691772011-01-24T03:00:00.000+09:002011-01-24T03:00:43.944+09:00FxCop Integrator 1.2.0 Released: Support Code Analysis Behavior Customization<div>
I've just released FxCop Integrator 1.2.0. It supports code analysis behavior customization so that an user can specify RuleSet and some FxCopCmd options.</div>
<div>
<br />
FxCop Integrator 1.2.0 is available <a href="http://bit.ly/f0zwmh">here</a>.<br />
<br />
<u>Summary of New Feature</u></div>
<div>
Now FxCop Integrator shows [Edit Code Analysis Configuration] in a context menu of Solution or Project.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnCWdfiYZklu9-GPUronDYSSKxnJLcRk8CSnUwnEn3AiZKXdKMZNRSFzdykhxv8hT_ZsHdZtsrUHwNAk15bqqVjR-AvMswADjPaINiXwyfI0_v_m2WOuUqUt9JEEKuZcvXa-NH1LNoyi0/s1600/ContextMenu.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="218" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnCWdfiYZklu9-GPUronDYSSKxnJLcRk8CSnUwnEn3AiZKXdKMZNRSFzdykhxv8hT_ZsHdZtsrUHwNAk15bqqVjR-AvMswADjPaINiXwyfI0_v_m2WOuUqUt9JEEKuZcvXa-NH1LNoyi0/s320/ContextMenu.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">A new context menu [Edit Code Analysis Configuration]</td></tr>
</tbody></table>
<br /></div>
<div>
When you select this one, FxCop Integrator opens Code Analysis Configuration Editor window. In this window, you can specify following options:</div>
<div>
<br />
<ol>
<li>Whether or not analyzing code of a project</li>
<li>Whether or not searching GAC for missing reference assemblies</li>
<li>Whether or not suppressing analysis results against generated code</li>
<li>Timeout for analysis deadlock detection</li>
<li>Whether or not analyzing code with RuleSet</li>
</ol>
</div>
<div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ2glQa2focj1RA5Q-43Z03RQWeF8N602RGnN6Gqjcs44dot6NYM97d-wIvjmaZfJVnLvbZp7tyGEYQdsCzn4-QFrW3Jn_66X0YsI_GcpBfFUlq_HrPuj83qev96VVnGfRCGG5Zf_EPW0/s1600/snap000004.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="184" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ2glQa2focj1RA5Q-43Z03RQWeF8N602RGnN6Gqjcs44dot6NYM97d-wIvjmaZfJVnLvbZp7tyGEYQdsCzn4-QFrW3Jn_66X0YsI_GcpBfFUlq_HrPuj83qev96VVnGfRCGG5Zf_EPW0/s320/snap000004.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Code Analysis Configuration Editor window</td></tr>
</tbody></table>
<br /></div>
<div>
Do you notice that Code Analysis Configuration Editor has <b>Override </b>option?</div>
<div>
FxCop Integrator supports Solution Configuration and Project Configuration. Solution Configuration is used to analyze all projects in the solution. Project Configuration is used to analyze the specific project. If Solution Configuration and Project Configuration set different value to an option, and checked its Override, FxCop Integrator overrides option value of Solution Configuration with Project Configuration's value.</div>xianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.com0tag:blogger.com,1999:blog-7252456767151117837.post-64777073485244514302011-01-12T23:30:00.001+09:002011-01-12T23:41:47.583+09:00Comparison of Code Analysis Rules (VS2005, 2008, 2010, FxCop 1.35, 1.36 and 10.0)I put together a comparison table of Visual Studio code analysis and stand-alone FxCop rules. This is an update of <a href="http://code.msdn.microsoft.com/codeanalysis/Release/ProjectReleases.aspx?ReleaseId=556">Code Analysis and FxCop Rule Comparison</a>.<br />
<br />
<iframe frameborder="0" height="600" src="https://spreadsheets.google.com/pub?key=0At6zbeyEhwKbdDh4dlpGWmRMR1I4TjZ1eURhbDlaMUE&hl=en&single=true&gid=0&output=html&widget=true" width="600"></iframe>xianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.com0tag:blogger.com,1999:blog-7252456767151117837.post-44297978718143955232011-01-08T11:05:00.000+09:002011-01-08T11:05:31.762+09:00Design of FxCop Integrator New Feature: Support Ruleset and ConfigurationI'm designing "Code Analysis Configuration", a new feature of FxCop Integrator, to support Ruleset and code analysis behavior configuration.<br />
<br />
It will provide the following features.<br />
<br />
<ul>
<li>Enable/Disable rules with Ruleset</li>
<li>Set some FxCopCmd option</li>
<li>Apply configuration to all projects are contained a solution</li>
<li>Override configuration on a specific project</li>
<li>Visual Configuration Editor</li>
</ul>
<br />
<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<u>Enable/Disable rules with Ruleset</u></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
Ruleset is a logical grouping of code analysis rules. You can enable/disable rules with Ruleset.</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
I'll support to analyze your code with a built-in ruleset or a custom ruleset.</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<u>Set some FxCopCmd option</u></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
I'll enable to change some FxCopCmd option (e.g. whether FxCop searchs GAC for missing assembly or not, weather FxCop analyzes auto-generated code or not, and so on).</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<u>Apply configuration to all projects are contained a solution</u></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
If you create a configuration file for a solution, FxCop Integrator will use it to analyze each project is contained the solution.</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<u>Override configuration on a specific project</u></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
You'll be able to override "solution configuration" on a specific project. For example, you can use different Rulesets between "Common Feature Project" and "UI Project".</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<u>Visual Configuration Editor</u></div>
<div>
I'll implement Visual Configuration Editor to be able to edit above configurations in Visual Studio IDE. The following image is a preview of Visual Configuration Editor.</div>
<div>
<br /></div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="http://www.blogger.com/goog_1178841868"><img border="0" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfFq6X46lVJsSdxJjXm7i8_wQktDfL68OAEltoX14uY3MFt2cgizSpDdwWCTrGe490ZfMmRqsLQ1uvarU0cMFn4rdVQObXkINE0WlsEVlkiOw2MVtlg7JypIJq8c0rDZKnSkzsC6qZIIk/s400/VisualConfigurationEditorPreview.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Visual Configuration Editor Preview</td></tr>
</tbody></table>
<div>
<br /></div>xianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.com0tag:blogger.com,1999:blog-7252456767151117837.post-82294376622983043732011-01-08T07:20:00.000+09:002011-01-08T07:20:04.318+09:00FxCop Integrator 1.1.1 Released: Code Analysis Bug FixI've just released FxCop Integrator 1.1.1, it contians a code analysis bug fix related "Web Site" project. In this version, you can analyze a solution contains "Web Site" project.<br />
<br />
FxCop Integrator 1.1.1 is available <a href="http://vs2010fxcopext.codeplex.com/releases/view/58671">here</a>.<br />
<br />
And, I plan to release v1.2.0 in Jan 16 2011. This version will support Ruleset and changing some FxCop options. So you will be able to customize code analysis behavior.xianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.com0tag:blogger.com,1999:blog-7252456767151117837.post-52717382421573626912011-01-08T07:09:00.002+09:002011-01-08T07:09:12.258+09:00First Posttestxianggohttp://www.blogger.com/profile/13338930941020700683noreply@blogger.com0