{"action":"created","issue":{"url":"https://api.github.com/repos/martincostello/sqllocaldb/issues/15","labels_url":"https://api.github.com/repos/martincostello/sqllocaldb/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/martincostello/sqllocaldb/issues/15/comments","events_url":"https://api.github.com/repos/martincostello/sqllocaldb/issues/15/events","html_url":"https://github.com/martincostello/sqllocaldb/issues/15","id":121679031,"number":15,"title":"The type initializer for 'System.Data.SqlLocalDb.Logger' threw an exception.","user":{"login":"damianh","id":57436,"avatar_url":"https://avatars.githubusercontent.com/u/57436?v=3","gravatar_id":"","url":"https://api.github.com/users/damianh","html_url":"https://github.com/damianh","followers_url":"https://api.github.com/users/damianh/followers","following_url":"https://api.github.com/users/damianh/following{/other_user}","gists_url":"https://api.github.com/users/damianh/gists{/gist_id}","starred_url":"https://api.github.com/users/damianh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damianh/subscriptions","organizations_url":"https://api.github.com/users/damianh/orgs","repos_url":"https://api.github.com/users/damianh/repos","events_url":"https://api.github.com/users/damianh/events{/privacy}","received_events_url":"https://api.github.com/users/damianh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/martincostello/sqllocaldb/labels/external","name":"external","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"martincostello","id":1439341,"avatar_url":"https://avatars.githubusercontent.com/u/1439341?v=3","gravatar_id":"","url":"https://api.github.com/users/martincostello","html_url":"https://github.com/martincostello","followers_url":"https://api.github.com/users/martincostello/followers","following_url":"https://api.github.com/users/martincostello/following{/other_user}","gists_url":"https://api.github.com/users/martincostello/gists{/gist_id}","starred_url":"https://api.github.com/users/martincostello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martincostello/subscriptions","organizations_url":"https://api.github.com/users/martincostello/orgs","repos_url":"https://api.github.com/users/martincostello/repos","events_url":"https://api.github.com/users/martincostello/events{/privacy}","received_events_url":"https://api.github.com/users/martincostello/received_events","type":"User","site_admin":false},"milestone":null,"comments":9,"created_at":"2015-12-11T10:15:47Z","updated_at":"2015-12-12T14:05:57Z","closed_at":null,"body":"We use SqlLocalDB mostly in tests at this time and we're seeing this occur occasionally (i.e. non-deterministically). When it does though, the error and stack trace is always the same?\r\n\r\n```\r\nThe type initializer for 'System.Data.SqlLocalDb.Logger' threw an exception.\r\n\r\n  at System.Data.SqlLocalDb.SqlLocalDbApi.GetInstanceNames()\r\n   at System.Data.SqlLocalDb.SqlLocalDbProvider.GetInstances()\r\n   at System.Data.SqlLocalDb.Extensions.GetOrCreateInstance(ISqlLocalDbProvider value, String instanceName)\r\n   at eVision.PermitVision.Infrastructure.DatabasePool.Initialize() in D:\\dev\\eVision.PermitVision\\src\\eVision.PermitVision.Tests\\Infrastructure\\DatabasePool.cs:line 120\r\n   at eVision.PermitVision.Infrastructure.DatabasePool..ctor() in D:\\dev\\eVision.PermitVision\\src\\eVision.PermitVision.Tests\\Infrastructure\\DatabasePool.cs:line 33\r\n   at eVision.PermitVision.Infrastructure.DatabasePool.<>c.<.cctor>b__24_0() in D:\\dev\\eVision.PermitVision\\src\\eVision.PermitVision.Tests\\Infrastructure\\DatabasePool.cs:line 23\r\n   at System.Lazy`1.CreateValue()\r\n\r\nType is not resolved for member 'Serilog.Context.ImmutableStack`1[[Serilog.Core.ILogEventEnricher, Serilog, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10]],Serilog.FullNetFx, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10'.\r\n\r\nat System.AppDomain.GetHostEvidence(Type type)\r\n   at System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type)\r\n   at System.Security.Policy.Evidence.RawEvidenceEnumerator.MoveNext()\r\n   at System.Security.Policy.Evidence.EvidenceEnumerator.MoveNext()\r\n   at System.Configuration.ClientConfigPaths.GetEvidenceInfo(AppDomain appDomain, String exePath, String& typeName)\r\n   at System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(AppDomain appDomain, String exePath)\r\n   at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)\r\n   at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)\r\n   at System.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord record)\r\n   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)\r\n   at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)\r\n   at System.Data.SqlLocalDb.Configuration.SqlLocalDbConfigurationSection.GetSection()\r\n   at System.Data.SqlLocalDb.SqlLocalDbConfig..cctor()\r\n```\r\n\r\nOften re-running the test \"fixes\" things, but I'd rather it never happen at all. It seems like a race condition loading types. What I don't understand is how or what serilog (we have that referenced in our tests) has to do with this. There is no app.config. There is a `.Tests.Config` which mostly contains binding redirects. Fails in ncrunch and resharper test runner.\r\n\r\nAny thoughts?"},"comment":{"url":"https://api.github.com/repos/martincostello/sqllocaldb/issues/comments/164157163","html_url":"https://github.com/martincostello/sqllocaldb/issues/15#issuecomment-164157163","issue_url":"https://api.github.com/repos/martincostello/sqllocaldb/issues/15","id":164157163,"user":{"login":"damianh","id":57436,"avatar_url":"https://avatars.githubusercontent.com/u/57436?v=3","gravatar_id":"","url":"https://api.github.com/users/damianh","html_url":"https://github.com/damianh","followers_url":"https://api.github.com/users/damianh/followers","following_url":"https://api.github.com/users/damianh/following{/other_user}","gists_url":"https://api.github.com/users/damianh/gists{/gist_id}","starred_url":"https://api.github.com/users/damianh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damianh/subscriptions","organizations_url":"https://api.github.com/users/damianh/orgs","repos_url":"https://api.github.com/users/damianh/repos","events_url":"https://api.github.com/users/damianh/events{/privacy}","received_events_url":"https://api.github.com/users/damianh/received_events","type":"User","site_admin":false},"created_at":"2015-12-12T14:05:56Z","updated_at":"2015-12-12T14:05:56Z","body":"Will try it out possibly tomorrow, but definitely Monday. cheers.\nOn 11 Dec 2015 2:39 pm, \"Martin Costello\" <notifications@github.com> wrote:\n\n> I've just committed 45e799d\n> <https://github.com/martincostello/sqllocaldb/commit/45e799dc63855a41ede28b5c95b531d1b7139c52>\n> to lazily initialize the default logger. Does a build with that change fix\n> your issue?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/martincostello/sqllocaldb/issues/15#issuecomment-163938042>\n> .\n>\n"}}