{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/2779","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/2779/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/2779/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/2779/events","html_url":"https://github.com/dotnet/roslyn/issues/2779","id":76583444,"number":2779,"title":"MSBuildWorkspace and WPF Projects","user":{"login":"JoshVarty","id":1249087,"avatar_url":"https://avatars.githubusercontent.com/u/1249087?v=3","gravatar_id":"","url":"https://api.github.com/users/JoshVarty","html_url":"https://github.com/JoshVarty","followers_url":"https://api.github.com/users/JoshVarty/followers","following_url":"https://api.github.com/users/JoshVarty/following{/other_user}","gists_url":"https://api.github.com/users/JoshVarty/gists{/gist_id}","starred_url":"https://api.github.com/users/JoshVarty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoshVarty/subscriptions","organizations_url":"https://api.github.com/users/JoshVarty/orgs","repos_url":"https://api.github.com/users/JoshVarty/repos","events_url":"https://api.github.com/users/JoshVarty/events{/privacy}","received_events_url":"https://api.github.com/users/JoshVarty/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/Enhancement","name":"Enhancement","color":"fc2929"}],"state":"open","locked":false,"assignee":{"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},"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":24,"closed_issues":640,"state":"open","created_at":"2015-01-15T20:45:24Z","updated_at":"2015-06-12T19:52:52Z","due_on":null,"closed_at":null},"comments":21,"created_at":"2015-05-15T04:05:01Z","updated_at":"2015-06-12T20:18:59Z","closed_at":null,"body":"I'm trying to compile a WPF project using `MSBuildWorkspace`. Should this work out of the box, or do I need to do anything special to set it up?\r\n\r\nWhen I open a .sln containing a WPF project and try to compile I receive two errors:\r\n\r\n```\r\nC:\\Users\\Josh\\Documents\\GitHub\\Orange\\WpfApplication1\\WpfApplication1\\MainWindow.xaml.cs(25,13): error CS0103: The name 'InitializeComponent' does not exist in the current context\r\n```\r\nand\r\n\r\n```\r\nerror CS5001: Program does not contain a static 'Main' method suitable for an entry point\r\n```\r\n\r\nTo reproduce, simply create a new WPF project. (Mine was WPFApplication1.sln). Then just load into a workspace and try to compile the project.\r\n\r\n```CSharp\r\nvar msws = MSBuildWorkspace.Create(new Dictionary<string, string> { { \"CheckForSystemRuntimeDependency\", \"true\" } });\r\nvar soln = msws.OpenSolutionAsync(@\"C:\\Users\\Josh\\Documents\\GitHub\\Orange\\WpfApplication1\\WpfApplication1.sln\").Result;\r\nvar comp = soln.Projects.First().GetCompilationAsync().Result;\r\nvar errs = comp.GetDiagnostics().Where(n => n.Severity == DiagnosticSeverity.Error).ToList();\r\n//Two errors :(\r\n```"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/111603476","html_url":"https://github.com/dotnet/roslyn/issues/2779#issuecomment-111603476","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/2779","id":111603476,"user":{"login":"JoshVarty","id":1249087,"avatar_url":"https://avatars.githubusercontent.com/u/1249087?v=3","gravatar_id":"","url":"https://api.github.com/users/JoshVarty","html_url":"https://github.com/JoshVarty","followers_url":"https://api.github.com/users/JoshVarty/followers","following_url":"https://api.github.com/users/JoshVarty/following{/other_user}","gists_url":"https://api.github.com/users/JoshVarty/gists{/gist_id}","starred_url":"https://api.github.com/users/JoshVarty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoshVarty/subscriptions","organizations_url":"https://api.github.com/users/JoshVarty/orgs","repos_url":"https://api.github.com/users/JoshVarty/repos","events_url":"https://api.github.com/users/JoshVarty/events{/privacy}","received_events_url":"https://api.github.com/users/JoshVarty/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T20:18:59Z","updated_at":"2015-06-12T20:18:59Z","body":"Just to add to @mattwar's above redirects, one also needs to add the following redirect: \r\n```\r\n<dependentAssembly>\r\n  <assemblyIdentity name=\"Microsoft.Build.Framework\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\"/>\r\n  <bindingRedirect oldVersion=\"0.0.0.0-99.9.9.9\" newVersion=\"14.0.0.0\"/>\r\n</dependentAssembly>\r\n```\r\n\r\nWhen I use both this and the above, I can confirm that my errors are no longer present. Thanks to everyone for your help!"}}