{"action":"created","issue":{"url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/issues/85","labels_url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/issues/85/comments","events_url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/issues/85/events","html_url":"https://github.com/Particular/NServiceBus.RavenDB/issues/85","id":107443654,"number":85,"title":"Could not load file or assembly Sparrow.dll","user":{"login":"SimonCropp","id":122666,"avatar_url":"https://avatars.githubusercontent.com/u/122666?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonCropp","html_url":"https://github.com/SimonCropp","followers_url":"https://api.github.com/users/SimonCropp/followers","following_url":"https://api.github.com/users/SimonCropp/following{/other_user}","gists_url":"https://api.github.com/users/SimonCropp/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonCropp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonCropp/subscriptions","organizations_url":"https://api.github.com/users/SimonCropp/orgs","repos_url":"https://api.github.com/users/SimonCropp/repos","events_url":"https://api.github.com/users/SimonCropp/events{/privacy}","received_events_url":"https://api.github.com/users/SimonCropp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/labels/Type:%20Bug","name":"Type: Bug","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/milestones/13","html_url":"https://github.com/Particular/NServiceBus.RavenDB/milestones/3.0.2","labels_url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/milestones/13/labels","id":1262720,"number":13,"title":"3.0.2","description":"","creator":{"login":"DavidBoike","id":427110,"avatar_url":"https://avatars.githubusercontent.com/u/427110?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidBoike","html_url":"https://github.com/DavidBoike","followers_url":"https://api.github.com/users/DavidBoike/followers","following_url":"https://api.github.com/users/DavidBoike/following{/other_user}","gists_url":"https://api.github.com/users/DavidBoike/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidBoike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidBoike/subscriptions","organizations_url":"https://api.github.com/users/DavidBoike/orgs","repos_url":"https://api.github.com/users/DavidBoike/repos","events_url":"https://api.github.com/users/DavidBoike/events{/privacy}","received_events_url":"https://api.github.com/users/DavidBoike/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":4,"state":"closed","created_at":"2015-08-19T15:05:27Z","updated_at":"2015-09-23T08:19:51Z","due_on":null,"closed_at":"2015-09-21T10:44:13Z"},"comments":1,"created_at":"2015-09-21T04:42:11Z","updated_at":"2015-09-23T08:20:49Z","closed_at":null,"body":"## Symptoms\r\n\r\nAt startup a `TypeInitializationException: Could not load file or assembly Sparrow.dll` is thrown. See the full stack trace bellow.\r\n\r\nThe reason is:\r\n\r\n* Raven uses Costura.\r\n* `Raven.Abstractions.Logging.LogManager` exists in `Raven.Abstractions.dll`.\r\n* `Raven.Abstractions` references `Sparrow.dll`.\r\n* `Raven.Client.Lightweight.dll` is the one that is Costura merged when we try to \r\nset `CurrentLogManager` it will try to load `Sparrow.dll` before `Raven.Client.Lightweight`\r\nhas had a chance to plug into the assembly load pipeline.\r\n\r\n## Resolution\r\n\r\nForce a fake assembly load at startup by using `typeof` on a type that exists in `Raven.Client.Lightweigh.dll`\r\n\r\n## Who's affected\r\n\r\nPossibly anyone using the default settings (without passing in a custom DocumentStore) of NServiceBus.RavenDB.\r\n\r\n---\r\n\r\n```\r\nSystem.TypeInitializationException was unhandled\r\n  _HResult=-2146233036\r\n  _message=The type initializer for 'Raven.Abstractions.Logging.LogManager' threw an exception.\r\n  HResult=-2146233036\r\n  IsTransient=false\r\n  Message=The type initializer for 'Raven.Abstractions.Logging.LogManager' threw an exception.\r\n  Source=Raven.Abstractions\r\n  TypeName=Raven.Abstractions.Logging.LogManager\r\n  StackTrace:\r\n       at Raven.Abstractions.Logging.LogManager.set_CurrentLogManager(ILogManager value)\r\n       at NServiceBus.Persistence.RavenDBPersistence.<.ctor>b__0(SettingsHolder s) in c:\\Code\\NServiceBus.RavenDB\\src\\NServiceBus.RavenDB\\RavenDBPersistence.cs:line 21\r\n       at NServiceBus.Persistence.PersistenceDefinition.ApplyDefaults(SettingsHolder settings) in c:\\BuildAgent\\work\\3206e2123f54fce4\\src\\NServiceBus.Core\\Persistence\\PersistenceDefinition.cs:line 93\r\n       at NServiceBus.Persistence.PersistenceStartup.Run(Configure config) in c:\\BuildAgent\\work\\3206e2123f54fce4\\src\\NServiceBus.Core\\Persistence\\PersistenceStartup.cs:line 38\r\n       at NServiceBus.Configure.<Initialize>b__6(IWantToRunBeforeConfigurationIsFinalized t) in c:\\BuildAgent\\work\\3206e2123f54fce4\\src\\NServiceBus.Core\\Configure.cs:line 113\r\n       at NServiceBus.Configure.<>c__DisplayClassc`1.<ActivateAndInvoke>b__b(Type t) in c:\\BuildAgent\\work\\3206e2123f54fce4\\src\\NServiceBus.Core\\Configure.cs:line 183\r\n       at NServiceBus.Configure.ForAllTypes[T](IEnumerable`1 types, Action`1 action) in c:\\BuildAgent\\work\\3206e2123f54fce4\\src\\NServiceBus.Core\\Configure.cs:line 137\r\n       at NServiceBus.Configure.ActivateAndInvoke[T](IList`1 types, Action`1 action) in c:\\BuildAgent\\work\\3206e2123f54fce4\\src\\NServiceBus.Core\\Configure.cs:line 180\r\n       at NServiceBus.Configure.Initialize() in c:\\BuildAgent\\work\\3206e2123f54fce4\\src\\NServiceBus.Core\\Configure.cs:line 113\r\n       at NServiceBus.Bus.Create(BusConfiguration configuration) in c:\\BuildAgent\\work\\3206e2123f54fce4\\src\\NServiceBus.Core\\Bus.cs:line 19\r\n       at Program.Main() in \\Server\\Program.cs:line 23\r\n  InnerException: System.IO.FileNotFoundException\r\n       _HResult=-2147024894\r\n       _message=Could not load file or assembly 'Sparrow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593' or one of its dependencies. The system cannot find the file specified.\r\n       HResult=-2147024894\r\n       IsTransient=false\r\n       Message=Could not load file or assembly 'Sparrow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593' or one of its dependencies. The system cannot find the file specified.\r\n       Source=Raven.Abstractions\r\n       FileName=Sparrow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593\r\n       FusionLog=Assembly manager loaded from:  C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\clr.dll\r\nRunning under executable  \r\n\\ravendb\\Version_5\\Server\\bin\\Debug\\Server.exe\r\n--- A detailed error log follows. \r\n```"},"comment":{"url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/issues/comments/142527056","html_url":"https://github.com/Particular/NServiceBus.RavenDB/issues/85#issuecomment-142527056","issue_url":"https://api.github.com/repos/Particular/NServiceBus.RavenDB/issues/85","id":142527056,"user":{"login":"SimonCropp","id":122666,"avatar_url":"https://avatars.githubusercontent.com/u/122666?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonCropp","html_url":"https://github.com/SimonCropp","followers_url":"https://api.github.com/users/SimonCropp/followers","following_url":"https://api.github.com/users/SimonCropp/following{/other_user}","gists_url":"https://api.github.com/users/SimonCropp/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonCropp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonCropp/subscriptions","organizations_url":"https://api.github.com/users/SimonCropp/orgs","repos_url":"https://api.github.com/users/SimonCropp/repos","events_url":"https://api.github.com/users/SimonCropp/events{/privacy}","received_events_url":"https://api.github.com/users/SimonCropp/received_events","type":"User","site_admin":false},"created_at":"2015-09-23T08:20:49Z","updated_at":"2015-09-23T08:20:49Z","body":"@sfarmar please upload a repro"}}