今天使用Visual Studio 2010,在停止使用Visual Assist X扩展的时候,发现VS报错。具体错误不明,只是说可能是由某个扩展导致。如下图
依照错误提示的地址,却发现“C:\Users\username\AppData\Roaming\Microsoft\VisualStudio\10.0”目录下并没有需要找的ActivityLog.xml文件。。。。
再看提示,明白了。运行的参数不对。
运行——CMD,进入命令行。
执行cd "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE",进入Visual Studio 2010的目录。
在执行devenv.exe /log。该命令会运行VS。
再进入C:\Users\username\AppData\Roaming\Microsoft\VisualStudio\10.0目录,发现有ActivityLog.xml了。打开一看,部分内容如下:
<entry> <record>720</record> <time>2012/04/27 08:50:09.316</time> <type>Information</type> <source>VisualStudio</source> <description>Entering function VBDispatch::GetTypeLib</description> </entry> <entry> <record>721</record> <time>2012/04/27 08:50:09.319</time> <type>Information</type> <source>VisualStudio</source> <description>Leaving function VBDispatch::GetTypeLib</description> <guid>{80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2}</guid> </entry> <entry> <record>722</record> <time>2012/04/27 08:50:09.768</time> <type>Error</type> <source>Editor or Editor Extension</source> <description>System.ArgumentOutOfRangeException: 指定的参数已超出有效值的范围。
参数名: end
 在 Microsoft.VisualStudio.Text.SnapshotSpan..ctor(SnapshotPoint start, SnapshotPoint end)
 在 Microsoft.VisualStudio.Text.Formatting.Implementation.FormattedLine.get_ExtentAsMappingSpan()
 在 Microsoft.VisualStudio.Text.AdornmentLibrary.Squiggles.Implementation.SquiggleVisualManager.GetNormalizedSquiggleSpanCollections(ITextViewLine line)
 在 Microsoft.VisualStudio.Text.AdornmentLibrary.Squiggles.Implementation.SquiggleVisualManager.UpdateVisualsOn(IEnumerable`1 lines, Boolean removeOldSquiggles)
 在 Microsoft.VisualStudio.Text.AdornmentLibrary.Squiggles.Implementation.SquiggleVisualManager.OnLayoutChanged(Object sender, TextViewLayoutChangedEventArgs e)
 在 Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)</description> </entry> <entry> <record>723</record> <time>2012/04/27 08:50:09.841</time> <type>Error</type> <source>Editor or Editor Extension</source> <description>System.ArgumentOutOfRangeException: 指定的参数已超出有效值的范围。
参数名: length
 在 Microsoft.VisualStudio.Text.Span..ctor(Int32 start, Int32 length)
 在 Microsoft.VisualStudio.Text.Formatting.Implementation.FormattedLine.get_Extent()
 在 Microsoft.VisualStudio.Text.Editor.Implementation.GlyphMargin.OnLayoutChanged(Object sender, TextViewLayoutChangedEventArgs e)
 在 Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)</description> </entry>
从以上内容可看出,错误的关键在这里:
<type>Error</type> <source>Editor or Editor Extension</source> <description>System.ArgumentOutOfRangeException: .....</description>
从错误描述来看,是参数超出有效值的范围的异常。
在出现异常之前,都是在VS中输入了半边冒号,然后输入了中文的标点符号。就报错了。
在网上找了一圈,很多人说是注册表的事,但是发现我的注册表没有问题。也就是不是这个问题。到目前,问题还是没解决,但是可以避开,就是输入中文符号之前先把冒号输全了。
有谁有解决方案可联系我。