{"action":"created","issue":{"url":"https://api.github.com/repos/NickStrupat/EntityFramework.Triggers/issues/32","repository_url":"https://api.github.com/repos/NickStrupat/EntityFramework.Triggers","labels_url":"https://api.github.com/repos/NickStrupat/EntityFramework.Triggers/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/NickStrupat/EntityFramework.Triggers/issues/32/comments","events_url":"https://api.github.com/repos/NickStrupat/EntityFramework.Triggers/issues/32/events","html_url":"https://github.com/NickStrupat/EntityFramework.Triggers/issues/32","id":316918356,"number":32,"title":"EF Core 2.0.2 Add-Migration Problems","user":{"login":"jensschmidbauer","id":24657073,"avatar_url":"https://avatars0.githubusercontent.com/u/24657073?v=4","gravatar_id":"","url":"https://api.github.com/users/jensschmidbauer","html_url":"https://github.com/jensschmidbauer","followers_url":"https://api.github.com/users/jensschmidbauer/followers","following_url":"https://api.github.com/users/jensschmidbauer/following{/other_user}","gists_url":"https://api.github.com/users/jensschmidbauer/gists{/gist_id}","starred_url":"https://api.github.com/users/jensschmidbauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jensschmidbauer/subscriptions","organizations_url":"https://api.github.com/users/jensschmidbauer/orgs","repos_url":"https://api.github.com/users/jensschmidbauer/repos","events_url":"https://api.github.com/users/jensschmidbauer/events{/privacy}","received_events_url":"https://api.github.com/users/jensschmidbauer/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-23T17:57:54Z","updated_at":"2018-04-24T09:03:49Z","closed_at":"2018-04-24T09:03:49Z","author_association":"NONE","body":"Hi there,\r\n\r\nI'm currently setting up a new project with Entity Framework Core 2.0.2 (target framework is net461 and platform x64) and tried to install EntityFramework.Triggers, but I have two problems getting the Add-Migration command to work again (like it did before I installed the package).\r\n\r\n\r\nThe first try was only installing the package and inheriting from DbContextWithTriggers. The result was Add-Migration did not recognize my DbContext any more (\"No DbContext named '...' was found\").\r\nIs this quite normal?\r\n\r\n\r\nSo, next try was with the alternative way of overwriting SaveChanges-Methods. This time Add-Migration worked as before. But there's no trigger defined yet.\r\nNext step was to add a test trigger in my user entity:\r\n\r\n```\r\nstatic User\r\n{\r\n    Triggers<User>.Inserted += o => {};\r\n}\r\n```\r\n\r\nand run Add-Migration again, resulting in a FileLoadException on trying to load \"Microsoft.EntityFrameworkCore, Version 2.0.0.0\" (instead of 2.0.2.0 which is used everywhere)\r\n\r\nSystem.TypeInitializationException: Der Typeninitialisierer für \"EntityModel.User\" hat eine Ausnahme verursacht. ---> System.IO.FileLoadException: Die Datei oder Assembly \"Microsoft.EntityFrameworkCore, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60\" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)\r\n   bei EntityModel.User..cctor()\r\n\r\nand the exceptions's FusionLog property states it's called by \"EntityFrameworkCore.Triggers, Version=1.1.1.0\":\r\n\r\n\r\nI can't any reference to version 2.0.0.0 anywhere und don't have any further ideas how to solve this for the moment.\r\nHope you can help me.\r\n"},"comment":{"url":"https://api.github.com/repos/NickStrupat/EntityFramework.Triggers/issues/comments/383858870","html_url":"https://github.com/NickStrupat/EntityFramework.Triggers/issues/32#issuecomment-383858870","issue_url":"https://api.github.com/repos/NickStrupat/EntityFramework.Triggers/issues/32","id":383858870,"user":{"login":"jensschmidbauer","id":24657073,"avatar_url":"https://avatars0.githubusercontent.com/u/24657073?v=4","gravatar_id":"","url":"https://api.github.com/users/jensschmidbauer","html_url":"https://github.com/jensschmidbauer","followers_url":"https://api.github.com/users/jensschmidbauer/followers","following_url":"https://api.github.com/users/jensschmidbauer/following{/other_user}","gists_url":"https://api.github.com/users/jensschmidbauer/gists{/gist_id}","starred_url":"https://api.github.com/users/jensschmidbauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jensschmidbauer/subscriptions","organizations_url":"https://api.github.com/users/jensschmidbauer/orgs","repos_url":"https://api.github.com/users/jensschmidbauer/repos","events_url":"https://api.github.com/users/jensschmidbauer/events{/privacy}","received_events_url":"https://api.github.com/users/jensschmidbauer/received_events","type":"User","site_admin":false},"created_at":"2018-04-24T09:03:49Z","updated_at":"2018-04-24T09:03:49Z","author_association":"NONE","body":"Hi again,\r\n\r\nfound the problem (solved both things).\r\n\r\nMy entity model is defined in a separate assembly and Add-Migration somehow uses that assembly as StartupProject - which strangely enough seems to have worked before (until I started to use triggers). So specifying the -StartupProject parameter with the correct project made both variants work.\r\n\r\nThanks for reading, sorry for bothering, problem solved.\r\n"}}
{"actor":{"display_login":"jensschmidbauer"}}