uli-weltersbach / XPathTools

A Visual Studio Extension which can run any XPath and XPath function; navigates through results at the click of a button. Can show and copy any XPath incl. XML namespaces, avoiding XML namespace induced headaches. Keeps track of the current XPath via the statusbar.
41 stars 4 forks source link

Error on VS2019 #41

Closed JBaltika closed 5 years ago

JBaltika commented 5 years ago

Hi, I am getting quite strange error a lot in VS2019 ... Any thoughts?

2894 Error Editor or Editor Extension System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) at EnvDTE._DTE.get_ActiveDocument() at ReasonCodeExample.XPathTools.ActiveDocument.get_Current() in C:\projects\xpathinformation\ReasonCodeExample.XPathTools\ActiveDocument.cs:line 14 at ReasonCodeExample.XPathTools.VisualStudioIntegration.XmlTextViewCreationListener.TextViewCreated(IWpfTextView textView) in C:\projects\xpathinformation\ReasonCodeExample.XPathTools\VisualStudioIntegration\XmlTextViewCreationListener.cs:line 38 at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.<>c__DisplayClass254_0.<BindContentTypeSpecificAssets>b__1() at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)
uli-weltersbach commented 5 years ago

@JBaltika Could you provide some steps to reproduce the error? And if the error occurs when working with a specific file, please attach the contents (unless it's sensitive data).

AlexN78 commented 5 years ago

I have the same error on 1st opening *.csporj file (TargetFramework=netcoreapp3.0) in VS2019 in preview mode (on preview tab). I do not have this error if I open the same file in a new tab (Edit Project File).

XPath Tools: version 6.0.2 (2019-08-12).

uli-weltersbach commented 5 years ago

@AlexN78 Could you attach/post the contents of the csproj-file?

uli-weltersbach commented 5 years ago

Steps to reproduce:

  1. Open VS 2019
  2. Create class library project for e.g. NetStandard 2.0
  3. Right-click the class library project
  4. Select "Edit Project File"
  5. The following error occurs on first open of the project file, as reported by @AlexN78:
    <entry>
    <record>2036</record>
    <time>2019/08/28 18:39:00.176</time>
    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <description>System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&#x000D;&#x000A;   at EnvDTE._DTE.get_ActiveDocument()&#x000D;&#x000A;   at ReasonCodeExample.XPathTools.ActiveDocument.get_Current() in C:\projects\xpathinformation\ReasonCodeExample.XPathTools\ActiveDocument.cs:line 14&#x000D;&#x000A;   at ReasonCodeExample.XPathTools.VisualStudioIntegration.XmlTextViewCreationListener.TextViewCreated(IWpfTextView textView) in C:\projects\xpathinformation\ReasonCodeExample.XPathTools\VisualStudioIntegration\XmlTextViewCreationListener.cs:line 38&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.&lt;&gt;c__DisplayClass254_0.&lt;BindContentTypeSpecificAssets&gt;b__1()&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)</description>
    </entry>

The error has only been observed/reproduced when editing csproj files using the steps outlined above. When opening csproj files "directly" (i.e. "File -> Open -> File..."), the error doesn't occur.

uli-weltersbach commented 5 years ago

This should be fixed in v6.0.3. Please reopen this issue if the error persists.