Visual Studio Troubleshooting Extensions with the Activity Log
来源:互联网 发布:linux open函数详解 编辑:程序博客网 时间:2024/06/16 11:56
One of the most powerful tools for troubleshooting issues that involve Visual Studio extensions is often overlooked, even though it has been around for quite some time (since VS 2005). Anyone wondering what Visual Studio is doing with their VS Package, Extension, MEF Component, or pkgdef file should ask the IDE for an activity log. In this article, I will show you not only how to generate an activity log file for Visual Studio, but also highlight some of the things you can find in it.
It’s important to note that this applies not only to the Visual Studio 2010 IDE, but also to applications built using the Visual Studio 2010 Shell (Isolated) (or Integrated). All of the examples will assume the case of Visual Studio running under 32-bit Windows 7. For other cases, substitute the appropriate file locations and names and registry root key.
Creating the Activity Log
This is as easy as it sounds. Here is the magic incantation required to generate a visual studio activity log file:
In this case, I’ve started a command prompt and navigated to the folder where the Visual Studio executable is installed before typing “devenv /log”.
The same command could also be given:
- from the Visual Studio Command Prompt (2010)
- using the full path to the executable ("C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe") from either a command prompt under Start - Accessories or in the Start – Rundialog
- on Windows 7, just by hitting the Windows key and typing “devenv /log” in the search box.
Finding the Activity Log
If “/log” is specified without adding an output path, the file is written to
%APPDATA%\Microsoft\VisualStudio\10.0\ActivityLog.xml
%APPDATA% resolves to “C:\Users\user\AppData\Roaming”
In previous releases of Visual Studio, there was a required parameter to /log that specified the full path for the output file. In VS 2010, this path is optional. You might find it useful to direct the log file to an easier to find location, such as the desktop:
devenv /log c:\users\user\desktop\activitylog.xml
Reading the Activity Log
Once you have reached the point in Visual Studio that you are trying to troubleshoot, it’s a good idea to close Visual Studio. Otherwise, it will continue to write to the log while you are trying to read it.
Notice that the log file is generated as XML. When Visual Studio starts writing the log, it also writes a corresponding XSL file next to the XML file that makes it easy to read in Internet Explorer. Go ahead and browse to the file’s location and double-click on it.
At the top of the file is a summary of how many lines of “infos” (sic), “warnings”, and “errors” are listed. Below that are the actual log items, which have up to 7 columns of information.
columndescription#sequential item numberTypeblank for information, “Warning” (highlighted in yellow), or “Error” (highlighted in red)Descriptionthe activity, which may optionally include a registry or file pathGUIDassociated GUID, typically for a VS PackageHrHRESULT value that may be useful for troubleshootingSourcemodule writing the log itemTime (UTC)timestamp for the item in UTC (not local) timeActivity Log Items
The activity log is full of more information than can adequately be addressed in any detail by a single blog post. However, several activities are worth noting:
- Version of Visual Studio and .NET Framework
- Configuration and state information about the pkgdef cache
- If the pkgdef cache is found to be out-of-date, each discovered pkgdef file is listed, as it is parsed and loaded
- Each VS Package that is loaded, including success and failure
- Each VS Extensions loaded through the Extension Manager and whether it is enabled
- Each MEF Component loaded and whether it came from the cache
- Each category exported by the Profile manager
Summary
Those are the basics for creating, finding, and reading the Visual Studio Activity Log. Hopefully, this will give you a powerful tool for troubleshooting issues with VS Packages, VS Extensions, MEF Components, and pkgdef files. Try running Visual Studio with /log and see what useful insights you gain into what Visual Studio is doing.
转自:http://blogs.msdn.com/b/visualstudio/archive/2010/02/24/troubleshooting-with-the-activity-log.aspx
One example is https://social.msdn.microsoft.com/Forums/vstudio/en-US/089d0e1a-579d-4cfa-b5e3-c9a739b9d412/unexpected-system-error-mode-before-loading-package-visual-studio-xml-editor-package?forum=vssetup
- Visual Studio Troubleshooting Extensions with the Activity Log
- Beginning Programming with the Visual Studio 2005 Environment
- DDKBUILD - Integrating the Windows DDK with Visual Studio .Net
- Sharepoint 开发工具:Visual Studio Extensions for SharePoint Released
- Debug VBScript with Visual Studio
- Installing FLTK with Visual Studio
- redo log file troubleshooting
- MSDN-Extending the Windows Explorer with Name Space Extensions
- Safe! Repel Attacks on Your Code with the Visual Studio 2005 Safe C and C++ Libraries
- The Complete Reference to Professional SOA with Visual Studio 2005 (C# & VB 2005) .NET 3.0
- Using UTF-8 as the internal representation for strings in C and C++ with Visual Studio
- How to change the default browser to debug with in Visual Studio 2008?
- Build a .NET Application on the Oracle Database with Microsoft Visual Studio 2010
- This project is incompatible with the current version of Visual Studio
- How to build applications with OpenCV inside the Microsoft Visual Studio
- 解决VS2010打开项目时“This project is incompatible with the current version of Visual Studio”
- Fragment Communicating with the Activity
- Troubleshooting with Postfix Logs
- 消息5061,ALTER DATABASE 失败
- Spring Singleton, Request, Session Beans and Thread Safety
- CST和GMT时间的区别
- MySQL的安装和配置
- Mysql REPLACE INTO 的原理以及使用方法
- Visual Studio Troubleshooting Extensions with the Activity Log
- 周鸿祎:中国并非美国互联网的镜像或复制品
- 在multimap中使用find
- Android控件拖动的实现
- 紫外线消毒器:污水处理用紫外线消毒器
- Android中Parcel的分析以及使用
- express4.x版本 的 post 提交
- SQL Server笔记(1)
- Chrome内核解析 -- 背景篇:构建DOM Tree, Render Tree, RenderLayer Tree