{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/3423","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/3423/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/3423/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/3423/events","html_url":"https://github.com/dotnet/roslyn/pull/3423","id":87045152,"number":3423,"title":"Pass (IntPtr)(-1) to ThrowExceptionForHR calls to ignore existing error info","user":{"login":"pharring","id":9952654,"avatar_url":"https://avatars.githubusercontent.com/u/9952654?v=3","gravatar_id":"","url":"https://api.github.com/users/pharring","html_url":"https://github.com/pharring","followers_url":"https://api.github.com/users/pharring/followers","following_url":"https://api.github.com/users/pharring/following{/other_user}","gists_url":"https://api.github.com/users/pharring/gists{/gist_id}","starred_url":"https://api.github.com/users/pharring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pharring/subscriptions","organizations_url":"https://api.github.com/users/pharring/orgs","repos_url":"https://api.github.com/users/pharring/repos","events_url":"https://api.github.com/users/pharring/events{/privacy}","received_events_url":"https://api.github.com/users/pharring/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-IDE","name":"Area-IDE","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/cla-already-signed","name":"cla-already-signed","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/1","html_url":"https://github.com/dotnet/roslyn/milestones/1.0%20(stable)","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/1/labels","id":937397,"number":1,"title":"1.0 (stable)","description":"This is our 1.0 Milestone. ","creator":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"open_issues":39,"closed_issues":617,"state":"open","created_at":"2015-01-15T20:45:24Z","updated_at":"2015-06-10T17:29:14Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-06-10T17:27:31Z","updated_at":"2015-06-10T17:54:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/3423","html_url":"https://github.com/dotnet/roslyn/pull/3423","diff_url":"https://github.com/dotnet/roslyn/pull/3423.diff","patch_url":"https://github.com/dotnet/roslyn/pull/3423.patch"},"body":"Fixes TFS bug 961110\r\n\r\n__Customer scenario:__\r\nCustomer has a VS package which hooks the \"OnBeginBuild\" event in order to generate a unique name for every build. It does this by renaming one of the source files.\r\n In Dev12 this works. In Dev14, this throws an exception with the confusing message \"The data necessary to complete this operation is not yet available.\"\r\n\r\n__Root cause__\r\nAs part of the rename, the project system asks for an Intellisense build but, since we've just started a full build, MSBuild throws a ComException with the HRESULT of E_PENDING. This HRESULT is ignored, but then the project system calls into Roslyn FileCodeModel to make the rename. Roslyn's FileCodeModel, for compatibility reasons, attempts to return E_NOTIMPL to the caller by calling Marshal.ThrowExceptionForHR(E_NOTIMPL). However, since there's already an unreported exception on this thread, the runtime ignores E_NOTIMPL and returns E_PENDING instead. E_NOTIMPL is handled very specially by the project system (ultimately resulting in S_OK), but E_PENDING is not, so that result is returned to the caller.\r\n\r\n__Fix__\r\nThe fix is to call the 2-argument overload of ThrowExceptionForHR and pass (IntPtr)(-1) for the 2nd arg which tells the runtime to ignore any existing IErrorInfo and use the HRESULT passed in the 1st arg.\r\n\r\n__Testing__\r\nManual testing so far.\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/110853386","html_url":"https://github.com/dotnet/roslyn/pull/3423#issuecomment-110853386","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/3423","id":110853386,"user":{"login":"jasonmalinowski","id":201340,"avatar_url":"https://avatars.githubusercontent.com/u/201340?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonmalinowski","html_url":"https://github.com/jasonmalinowski","followers_url":"https://api.github.com/users/jasonmalinowski/followers","following_url":"https://api.github.com/users/jasonmalinowski/following{/other_user}","gists_url":"https://api.github.com/users/jasonmalinowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonmalinowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonmalinowski/subscriptions","organizations_url":"https://api.github.com/users/jasonmalinowski/orgs","repos_url":"https://api.github.com/users/jasonmalinowski/repos","events_url":"https://api.github.com/users/jasonmalinowski/events{/privacy}","received_events_url":"https://api.github.com/users/jasonmalinowski/received_events","type":"User","site_admin":false},"created_at":"2015-06-10T17:54:20Z","updated_at":"2015-06-10T17:54:20Z","body":"Wow. that's subtle. :+1:"}}