{"action":"created","issue":{"url":"https://api.github.com/repos/AvaloniaUI/Avalonia/issues/1242","repository_url":"https://api.github.com/repos/AvaloniaUI/Avalonia","labels_url":"https://api.github.com/repos/AvaloniaUI/Avalonia/issues/1242/labels{/name}","comments_url":"https://api.github.com/repos/AvaloniaUI/Avalonia/issues/1242/comments","events_url":"https://api.github.com/repos/AvaloniaUI/Avalonia/issues/1242/events","html_url":"https://github.com/AvaloniaUI/Avalonia/issues/1242","id":267421949,"number":1242,"title":"Changes to entry point (Program.cs/App.xaml.cs) requirements","user":{"login":"kekekeks","id":1067584,"avatar_url":"https://avatars2.githubusercontent.com/u/1067584?v=4","gravatar_id":"","url":"https://api.github.com/users/kekekeks","html_url":"https://github.com/kekekeks","followers_url":"https://api.github.com/users/kekekeks/followers","following_url":"https://api.github.com/users/kekekeks/following{/other_user}","gists_url":"https://api.github.com/users/kekekeks/gists{/gist_id}","starred_url":"https://api.github.com/users/kekekeks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kekekeks/subscriptions","organizations_url":"https://api.github.com/users/kekekeks/orgs","repos_url":"https://api.github.com/users/kekekeks/repos","events_url":"https://api.github.com/users/kekekeks/events{/privacy}","received_events_url":"https://api.github.com/users/kekekeks/received_events","type":"User","site_admin":false},"labels":[{"id":483089472,"url":"https://api.github.com/repos/AvaloniaUI/Avalonia/labels/API","name":"API","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/AvaloniaUI/Avalonia/milestones/8","html_url":"https://github.com/AvaloniaUI/Avalonia/milestone/8","labels_url":"https://api.github.com/repos/AvaloniaUI/Avalonia/milestones/8/labels","id":2833255,"number":8,"title":"Beta 2","description":"","creator":{"login":"grokys","id":1775141,"avatar_url":"https://avatars1.githubusercontent.com/u/1775141?v=4","gravatar_id":"","url":"https://api.github.com/users/grokys","html_url":"https://github.com/grokys","followers_url":"https://api.github.com/users/grokys/followers","following_url":"https://api.github.com/users/grokys/following{/other_user}","gists_url":"https://api.github.com/users/grokys/gists{/gist_id}","starred_url":"https://api.github.com/users/grokys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grokys/subscriptions","organizations_url":"https://api.github.com/users/grokys/orgs","repos_url":"https://api.github.com/users/grokys/repos","events_url":"https://api.github.com/users/grokys/events{/privacy}","received_events_url":"https://api.github.com/users/grokys/received_events","type":"User","site_admin":true},"open_issues":11,"closed_issues":1,"state":"open","created_at":"2017-10-12T15:02:45Z","updated_at":"2017-10-22T14:37:31Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2017-10-21T23:28:24Z","updated_at":"2017-10-22T14:39:56Z","closed_at":null,"author_association":"OWNER","body":"Our new previewer needs to get all options from appbuilder, so it requires the type with entry point to have `BuildAvaloniaApp` static method.\r\n\r\nAnother problem that we need to solve is preloading all assemblies with interesting data (types, markup extensions, styles, etc) before AppBuilder actually starts doing anything. Having to provide them manually is inconvenient, so I propose to write an MSBuild task that will patch the target assembly.\r\n\r\nSo the entry point class should look somewhat like that:\r\n\r\n\r\n```csharp\r\n\r\n// Actual entry point\r\nstatic void Main(string[] args) => BuildAvaloniaApp().Start<MainWindow>();\r\n\r\n// App configuration, used by the entry point and previewer\r\nstatic AppBuilder BuildAvaloniaApp()\r\n   => AppBuilder\r\n        .Configure<App>(LoadAvaloniaAssemblies())\r\n        .UsePlatformDetect()\r\n        .UseReactiveUI();\r\n\r\n// Will be replaced by the actual code in MSBuild task\r\nstatic extern List<Assembly> LoadAvaloniaAssemblies();\r\n\r\n```\r\n\r\nMSBuild task should insert loading code for every assembly that has direct or indirect references to Avalonia *or* referenced using `clr-namespace` from XAML files.\r\n\r\nThat should solve our issues with AOT platforms and XmlnsNamespace attributes not being loaded in time. "},"comment":{"url":"https://api.github.com/repos/AvaloniaUI/Avalonia/issues/comments/338482540","html_url":"https://github.com/AvaloniaUI/Avalonia/issues/1242#issuecomment-338482540","issue_url":"https://api.github.com/repos/AvaloniaUI/Avalonia/issues/1242","id":338482540,"user":{"login":"jkoritzinsky","id":1571408,"avatar_url":"https://avatars2.githubusercontent.com/u/1571408?v=4","gravatar_id":"","url":"https://api.github.com/users/jkoritzinsky","html_url":"https://github.com/jkoritzinsky","followers_url":"https://api.github.com/users/jkoritzinsky/followers","following_url":"https://api.github.com/users/jkoritzinsky/following{/other_user}","gists_url":"https://api.github.com/users/jkoritzinsky/gists{/gist_id}","starred_url":"https://api.github.com/users/jkoritzinsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkoritzinsky/subscriptions","organizations_url":"https://api.github.com/users/jkoritzinsky/orgs","repos_url":"https://api.github.com/users/jkoritzinsky/repos","events_url":"https://api.github.com/users/jkoritzinsky/events{/privacy}","received_events_url":"https://api.github.com/users/jkoritzinsky/received_events","type":"User","site_admin":false},"created_at":"2017-10-22T14:39:56Z","updated_at":"2017-10-22T14:39:56Z","author_association":"OWNER","body":"Good point. We should figure out a way to patch the pdb as well then so we dont break step debugging. I think Mono.Cecil can do that, but I'm not positive."}}
{"actor":{"display_login":"jkoritzinsky"}}