{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/7206","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/7206/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/7206/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/7206/events","html_url":"https://github.com/dotnet/roslyn/issues/7206","id":120217323,"number":7206,"title":"NRE in CSharpProjectFile.GetReferences","user":{"login":"AdamSpeight2008","id":900107,"avatar_url":"https://avatars.githubusercontent.com/u/900107?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamSpeight2008","html_url":"https://github.com/AdamSpeight2008","followers_url":"https://api.github.com/users/AdamSpeight2008/followers","following_url":"https://api.github.com/users/AdamSpeight2008/following{/other_user}","gists_url":"https://api.github.com/users/AdamSpeight2008/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamSpeight2008/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamSpeight2008/subscriptions","organizations_url":"https://api.github.com/users/AdamSpeight2008/orgs","repos_url":"https://api.github.com/users/AdamSpeight2008/repos","events_url":"https://api.github.com/users/AdamSpeight2008/events{/privacy}","received_events_url":"https://api.github.com/users/AdamSpeight2008/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/Bug","name":"Bug","color":"fc2929"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Contributor%20Pain","name":"Contributor Pain","color":"e11d21"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Resolution-Fixed","name":"Resolution-Fixed","color":"cccccc"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/4","html_url":"https://github.com/dotnet/roslyn/milestones/1.2","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/4/labels","id":937402,"number":4,"title":"1.2","description":"This is our 1.2 Milestone.\r\n\r\n<!---\r\n@huboard:{\"order\":2.0}\r\n-->\r\n","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":575,"closed_issues":209,"state":"open","created_at":"2015-01-15T20:48:55Z","updated_at":"2015-12-07T01:38:20Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2015-12-03T16:42:15Z","updated_at":"2015-12-07T03:16:50Z","closed_at":"2015-12-06T23:00:27Z","body":"Targetsite\r\n```\r\n{Void GetReferences(CSharpCompilerInputs, Microsoft.Build.Execution.ProjectInstance, System.Collections.Generic.IEnumerable`1[Microsoft.CodeAnalysis.MetadataReference] ByRef, System.Collections.Generic.IEnumerable`1[Microsoft.CodeAnalysis.Diagnostics.AnalyzerReference] ByRef)}\r\n```\r\nSource\r\n```\r\nMicrosoft.CodeAnalysis.Workspaces.Desktop\r\n```\r\nStacktrace\r\n```\r\n   at Microsoft.CodeAnalysis.CSharp.CSharpProjectFileLoader.CSharpProjectFile.GetReferences(CSharpCompilerInputs compilerInputs, ProjectInstance executedProject, IEnumerable`1& metadataReferences, IEnumerable`1& analyzerReferences)\r\n   at Microsoft.CodeAnalysis.CSharp.CSharpProjectFileLoader.CSharpProjectFile.CreateProjectFileInfo(CSharpCompilerInputs compilerInputs, ProjectInstance executedProject)\r\n   at Microsoft.CodeAnalysis.CSharp.CSharpProjectFileLoader.CSharpProjectFile.<GetProjectFileInfoAsync>d__7.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.<LoadProjectAsync>d__40.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.<GetOrLoadProjectAsync>d__39.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.<OpenSolutionAsync>d__34.MoveNext()\r\n```\r\n\r\nVS Version Info\r\n```\r\nMicrosoft Visual Studio Community 2015\r\nVersion 14.0.24720.00 Update 1\r\nMicrosoft .NET Framework\r\nVersion 4.6.01055\r\n\r\nInstalled Version: Community\r\n\r\nVisual Basic 2015   00322-20000-00000-AA613\r\nMicrosoft Visual Basic 2015\r\n\r\nVisual C# 2015   00322-20000-00000-AA613\r\nMicrosoft Visual C# 2015\r\n\r\nVisual C++ 2015   00322-20000-00000-AA613\r\nMicrosoft Visual C++ 2015\r\n\r\nApplication Insights Tools for Visual Studio Package   1.0\r\nApplication Insights Tools for Visual Studio\r\n\r\nASP.NET and Web Tools 2015.1 (Beta8)   14.1.11106.0\r\nASP.NET and Web Tools 2015.1 (Beta8)\r\n\r\nASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0\r\nFor additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563\r\n\r\nASP.NET Web Frameworks and Tools 2013   5.2.30624.0\r\nFor additional information, visit http://www.asp.net/\r\n\r\nCommon Azure Tools   1.5\r\nProvides common services for use by Azure Mobile Services and Microsoft Azure Tools.\r\n\r\nExtensibility Tools   1.5.103\r\nAn extension for making it easier to write Visual Studio extensions\r\n\r\nGitHub.VisualStudio   1.0\r\nA Visual Studio Extension that brings the GitHub Flow into Visual Studio.\r\n\r\nILSpy.AddIn   1.0\r\nIntegration of the ILSpy Decompiler into Visual Studio.\r\n\r\nMicrosoft Azure Mobile Services Tools   1.4\r\nMicrosoft Azure Mobile Services Tools\r\n\r\nMsiler   1.0\r\nMSIL Code Viewer for Visual Studio 2013\r\n\r\nNuGet Package Manager   3.3.0\r\nNuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.\r\n\r\nPreEmptive Analytics Visualizer   1.2\r\nMicrosoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.\r\n\r\nSQL Server Data Tools   14.0.50616.0\r\nMicrosoft SQL Server Data Tools\r\n\r\nSyntax Visualizer   1.0\r\nAn extension for visualizing Roslyn SyntaxTrees.\r\n\r\nTypeScript   1.7.4.0\r\nTypeScript for Microsoft Visual Studio\r\n```\r\n-----\r\nrepo\r\n\r\n```vb.net\r\nModule Module1\r\n\r\n    Sub Main()\r\n        Dim SLN = \"C:\\Users\\Adam\\Downloads\\roslyn-master\\Compilers.sln\"\r\n        Dim res = <results></results>\r\n        Dim sw As New Diagnostics.Stopwatch\r\n        Dim ws = MSBuild.MSBuildWorkspace.Create()\r\n        Dim tsk = ws.OpenSolutionAsync(SLN) ` <-- Exception happens here.\r\n        tsk.Wait()\r\n        Dim soln = tsk.Result\r\n        For Each p In soln.Projects\r\n            If p.Language <> LanguageNames.VisualBasic Then Continue For\r\n            Dim pn = <Project name=<%= p.Name %> path=<%= p.OutputFilePath %>></Project>\r\n            Console.WriteLine($\"{p.Name} [{p.OutputFilePath}])\")\r\n            For Each d In p.Documents\r\n                If d.SourceCodeKind = SourceCodeKind.Regular Then\r\n                    Dim st As SourceText = d.GetTextAsync.Result\r\n                    sw.Restart()\r\n                    Dim sn = SyntaxFactory.ParseSyntaxTree(st)\r\n                    sw.Stop()\r\n                    Dim tn = <doc timing=<%= sw.ElapsedMilliseconds %> name=<%= d.Name %>/>\r\n                    pn.Add(tn)\r\n                End If\r\n            Next\r\n            res.Add(pn)\r\n        Next\r\n        Console.WriteLine(res.ToString)\r\n        Console.ReadKey()\r\n    End Sub\r\n\r\nEnd Module\r\n```"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/162398931","html_url":"https://github.com/dotnet/roslyn/issues/7206#issuecomment-162398931","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/7206","id":162398931,"user":{"login":"mattwar","id":3387305,"avatar_url":"https://avatars.githubusercontent.com/u/3387305?v=3","gravatar_id":"","url":"https://api.github.com/users/mattwar","html_url":"https://github.com/mattwar","followers_url":"https://api.github.com/users/mattwar/followers","following_url":"https://api.github.com/users/mattwar/following{/other_user}","gists_url":"https://api.github.com/users/mattwar/gists{/gist_id}","starred_url":"https://api.github.com/users/mattwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattwar/subscriptions","organizations_url":"https://api.github.com/users/mattwar/orgs","repos_url":"https://api.github.com/users/mattwar/repos","events_url":"https://api.github.com/users/mattwar/events{/privacy}","received_events_url":"https://api.github.com/users/mattwar/received_events","type":"User","site_admin":false},"created_at":"2015-12-07T03:16:50Z","updated_at":"2015-12-07T03:16:50Z","body":"You'll only get the error if you are attempting to open a project for a language whose workspace dll is not in the same directory as your exe. So if you are only opening VB projects and you have the vb dll's but not the C# dll's it should work without error.  It's easiest if your app has a direct reference to both C# and VB dll's and have those dll's automatically copied to your application output directory."}}