{"action":"created","issue":{"url":"https://api.github.com/repos/adamdriscoll/poshtools/issues/312","labels_url":"https://api.github.com/repos/adamdriscoll/poshtools/issues/312/labels{/name}","comments_url":"https://api.github.com/repos/adamdriscoll/poshtools/issues/312/comments","events_url":"https://api.github.com/repos/adamdriscoll/poshtools/issues/312/events","html_url":"https://github.com/adamdriscoll/poshtools/issues/312","id":100500019,"number":312,"title":"Issue when comparing Powershell files in Visual Studio","user":{"login":"robertwwebb","id":13762036,"avatar_url":"https://avatars.githubusercontent.com/u/13762036?v=3","gravatar_id":"","url":"https://api.github.com/users/robertwwebb","html_url":"https://github.com/robertwwebb","followers_url":"https://api.github.com/users/robertwwebb/followers","following_url":"https://api.github.com/users/robertwwebb/following{/other_user}","gists_url":"https://api.github.com/users/robertwwebb/gists{/gist_id}","starred_url":"https://api.github.com/users/robertwwebb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertwwebb/subscriptions","organizations_url":"https://api.github.com/users/robertwwebb/orgs","repos_url":"https://api.github.com/users/robertwwebb/repos","events_url":"https://api.github.com/users/robertwwebb/events{/privacy}","received_events_url":"https://api.github.com/users/robertwwebb/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/adamdriscoll/poshtools/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-12T09:12:04Z","updated_at":"2015-08-21T06:31:18Z","closed_at":null,"body":"My versions of Visual Studio and PS Tools are as follows:\r\n\r\nVS Enterprise 2015 v14.0.23107.0 D14REL\r\nPS Tools for VS 2015 v3.0.177\r\n\r\n1) Code Review Compare\r\n\r\nWhen doing a Visual Studio code review the first Powershell file I try to compare throws an exception.  Comparisons on other files are successful.  Nothing happens (i.e. no exceptions appear to be thrown, no file content displayed, no comparison displayed) on further attempts to compare the first file.\r\n\r\nInspecting Visual Studio's ActivityLog.xml, the exception is as follows:\r\n  <entry>\r\n    <type>Error</type>\r\n    <source>Editor or Editor Extension</source>\r\n    <description>System.NullReferenceException: Object reference not set to an instance of an object.&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Differencing.Implementation.DifferenceViewer.ScrollToChange(Difference difference)&#x000D;&#x000A;   at Microsoft.TeamFoundation.CodeReview.Controls.DiffViewViewModel.ScrollToFirstDifference()&#x000D;&#x000A;   at Microsoft.TeamFoundation.CodeReview.Controls.DiffViewViewModel.InitialScrollOnDiffViewOpened()&#x000D;&#x000A;   at Microsoft.TeamFoundation.CodeReview.Controls.DiffViewViewModel..ctor(SelectionNavigationState sharedState, CommentsModel commentsModel, IWpfTextView view, IDifferenceViewer diffViewer, DifferenceViewType viewType, String fileServerPath, IAdornmentLayer layer, IVsWindowFrame frame, IEditorFormatMap formatMap, IEditorOperations editorOperations)&#x000D;&#x000A;   at Microsoft.TeamFoundation.CodeReview.Components.DiffTextViewCreationListener.CreateViewModel(IWpfTextView textView, IDifferenceViewer diffViewer, DifferenceViewType viewType)&#x000D;&#x000A;   at Microsoft.TeamFoundation.CodeReview.Components.DiffTextViewCreationListener.&lt;&gt;c__DisplayClass5.&lt;InitializeComments&gt;b__3()&#x000D;&#x000A;   at Microsoft.VisualStudio.Utilities.PropertyCollection.GetOrCreateSingletonProperty[T](Object key, Func`1 creator)&#x000D;&#x000A;   at Microsoft.TeamFoundation.CodeReview.Components.DiffTextViewCreationListener.InitializeComments(IWpfTextView textView, IDifferenceViewer diffViewer, DifferenceViewType viewType)&#x000D;&#x000A;   at Microsoft.TeamFoundation.CodeReview.Components.DiffTextViewCreationListener.&lt;&gt;c__DisplayClass1.&lt;InitializeCommentsWhenDiffInitialized&gt;b__0(Object o, SnapshotDifferenceChangeEventArgs a)&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)</description>\r\n  </entry>\r\n\r\nThe exception is not thrown if I open a Powershell file in the IDE before attempting the comparison.\r\n\r\n2) Normal Compare\r\n\r\nWhen doing a Compare on any Powershell file (either right-click and select Compare, or by viewing History and then comparing 2 different versions) the first attempt fails.  The comparison window opens, but doesn't load anything.  Subsequent comparisons (on any file, including the first one which failed) work correctly.\r\n"},"comment":{"url":"https://api.github.com/repos/adamdriscoll/poshtools/issues/comments/133302586","html_url":"https://github.com/adamdriscoll/poshtools/issues/312#issuecomment-133302586","issue_url":"https://api.github.com/repos/adamdriscoll/poshtools/issues/312","id":133302586,"user":{"login":"robertwwebb","id":13762036,"avatar_url":"https://avatars.githubusercontent.com/u/13762036?v=3","gravatar_id":"","url":"https://api.github.com/users/robertwwebb","html_url":"https://github.com/robertwwebb","followers_url":"https://api.github.com/users/robertwwebb/followers","following_url":"https://api.github.com/users/robertwwebb/following{/other_user}","gists_url":"https://api.github.com/users/robertwwebb/gists{/gist_id}","starred_url":"https://api.github.com/users/robertwwebb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertwwebb/subscriptions","organizations_url":"https://api.github.com/users/robertwwebb/orgs","repos_url":"https://api.github.com/users/robertwwebb/repos","events_url":"https://api.github.com/users/robertwwebb/events{/privacy}","received_events_url":"https://api.github.com/users/robertwwebb/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T06:31:18Z","updated_at":"2015-08-21T06:31:18Z","body":"When doing a regular compare, yes.  When running a comparison while doing a code review the first file fails and the second one works correctly.  Subsequent attempts to compare the first file fail."}}