{"action":"opened","issue":{"url":"https://api.github.com/repos/dotnet/orleans/issues/1900","repository_url":"https://api.github.com/repos/dotnet/orleans","labels_url":"https://api.github.com/repos/dotnet/orleans/issues/1900/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/orleans/issues/1900/comments","events_url":"https://api.github.com/repos/dotnet/orleans/issues/1900/events","html_url":"https://github.com/dotnet/orleans/issues/1900","id":163556190,"number":1900,"title":"Orleans not working with latest asp.net core 1.0 release","user":{"login":"globeport","id":16024294,"avatar_url":"https://avatars.githubusercontent.com/u/16024294?v=3","gravatar_id":"","url":"https://api.github.com/users/globeport","html_url":"https://github.com/globeport","followers_url":"https://api.github.com/users/globeport/followers","following_url":"https://api.github.com/users/globeport/following{/other_user}","gists_url":"https://api.github.com/users/globeport/gists{/gist_id}","starred_url":"https://api.github.com/users/globeport/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globeport/subscriptions","organizations_url":"https://api.github.com/users/globeport/orgs","repos_url":"https://api.github.com/users/globeport/repos","events_url":"https://api.github.com/users/globeport/events{/privacy}","received_events_url":"https://api.github.com/users/globeport/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-03T10:22:45Z","updated_at":"2016-07-03T10:22:45Z","closed_at":null,"body":"Orleans and asp.net core web api seemed to be playing nicely together until the latest release of asp.net core 1.0. The offending update seems to be a move to Newtonsoft.Json 9.0.1.\r\n\r\nWith the web api project referencing the old Json.Net 8.0.3 I get the following output: (This is to be expected because asp.net Core now depends on Json.Net 9.0.1)\r\n\r\n```\r\nUnhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Could not load type 'Newtonsoft.Json.Serialization.CamelCaseNamingStrategy' from assembly 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.\r\n   at Microsoft.AspNetCore.Mvc.Formatters.JsonSerializerSettingsProvider.CreateSerializerSettings()\r\n   at Microsoft.AspNetCore.Mvc.MvcJsonOptions..ctor()\r\n   --- End of inner exception stack trace ---\r\n   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)\r\n   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)\r\n   at System.Activator.CreateInstance[T]()\r\n   at Microsoft.Extensions.Options.OptionsCache`1.CreateOptions()\r\n   at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)\r\n   at Microsoft.Extensions.Options.OptionsCache`1.get_Value()\r\n   at Microsoft.AspNetCore.Mvc.Formatters.Json.Internal.MvcJsonMvcOptionsSetup.<>c__DisplayClass0_0.<.ctor>b__0(MvcOptions options)\r\n   at Microsoft.Extensions.Options.OptionsCache`1.CreateOptions()\r\n   at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)\r\n   at Microsoft.Extensions.Options.OptionsCache`1.get_Value()\r\n   at Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.<>c.<AddMvcCoreServices>b__5_0(IServiceProvider s)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ClosedIEnumerableService.CallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ClosedIEnumerableService.CallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider provider)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)\r\n   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)\r\n   at Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app, Action`1 configureRoutes)\r\n   at Globeport.Server.WebApi.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) in D:\\Source\\Globeport\\Globeport.Server.WebApi\\Startup.cs:line 93\r\n   --- End of inner exception stack trace ---\r\n   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\r\n   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n   at Microsoft.AspNetCore.Hosting.Internal.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()\r\n   at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()\r\n   at Globeport.Server.WebApi.Program.Main(String[] args) in D:\\Source\\Globeport\\Globeport.Server.WebApi\\Program.cs:line 15\r\n```\r\n\r\n\r\nHowever, If I then reference the new Json.Net 9.0.1 package I get the following output during initialization of the Orleans client:\r\n\r\nDoes anyone have any ideas?\r\n\r\n```\r\nUnable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.\r\nException = System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.\r\n   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)\r\n   at System.Reflection.RuntimeAssembly.get_DefinedTypes()\r\n   at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()\r\n   at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()\r\n   at Orleans.CodeGenerator.RoslynCodeGenerator.GetTypesWithGeneratedSupportClasses()\r\n   at Orleans.CodeGenerator.RoslynCodeGenerator.GenerateForAssemblies(List`1 assemblies, Boolean runtime)\r\n   at Orleans.CodeGenerator.RoslynCodeGenerator.GenerateAndLoadForAssemblies(Assembly[] inputs)\r\n\r\n[2016-07-03 10:07:04.270 GMT     4      WARNING 103801  CodeGenerator   ]       Exception generating code for input assemblies:\r\nGlobeport.Server.WebApi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\r\nException:\r\nExc level 0: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.\r\n   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)\r\n   at System.Reflection.RuntimeAssembly.get_DefinedTypes()\r\n   at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()\r\n   at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()\r\n   at Orleans.CodeGenerator.RoslynCodeGenerator.GetTypesWithGeneratedSupportClasses()\r\n   at Orleans.CodeGenerator.RoslynCodeGenerator.GenerateForAssemblies(List`1 assemblies, Boolean runtime)\r\n   at Orleans.CodeGenerator.RoslynCodeGenerator.GenerateAndLoadForAssemblies(Assembly[] inputs)\r\nExc level 1: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 2: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 1: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 2: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 1: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 2: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 1: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 2: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 1: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 2: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 0: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.\r\n   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)\r\n   at System.Reflection.RuntimeAssembly.get_DefinedTypes()\r\n   at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()\r\n   at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()\r\n   at Orleans.CodeGenerator.RoslynCodeGenerator.GetTypesWithGeneratedSupportClasses()\r\n   at Orleans.CodeGenerator.RoslynCodeGenerator.GenerateForAssemblies(List`1 assemblies, Boolean runtime)\r\n   at Orleans.CodeGenerator.RoslynCodeGenerator.GenerateAndLoadForAssemblies(Assembly[] inputs)\r\nExc level 1: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 2: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 1: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 2: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 1: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 2: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 1: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 2: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 1: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nExc level 2: System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\nInitialization failed. System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.\r\n   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)\r\n   at System.Reflection.RuntimeAssembly.get_DefinedTypes()\r\n   at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()\r\n   at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()\r\n   at Orleans.CodeGenerator.RoslynCodeGenerator.GetTypesWithGeneratedSupportClasses()\r\n   at Orleans.CodeGenerator.RoslynCodeGenerator.GenerateForAssemblies(List`1 assemblies, Boolean runtime)\r\n   at Orleans.CodeGenerator.RoslynCodeGenerator.GenerateAndLoadForAssemblies(Assembly[] inputs)\r\n   at Orleans.CodeGeneration.CodeGeneratorManager.GenerateAndCacheCodeForAllAssemblies()\r\n   at Orleans.Runtime.AssemblyProcessor.Initialize()\r\n   at Orleans.OutsideRuntimeClient..ctor(ClientConfiguration cfg, GrainFactory grainFactory, Boolean secondary)\r\n   at Orleans.GrainClient.DoInternalInitialize(ClientConfiguration config, OutsideRuntimeClient runtimeClient)\r\n[11:07:04 ERR] Api unable to start. Error System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.\r\n\r\nUnhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.\r\n   at Globeport.Server.WebApi.Startup.ConfigureServices(IServiceCollection services) in D:\\Source\\Globeport\\Globeport.Server.WebApi\\Startup.cs:line 79\r\n   --- End of inner exception stack trace ---\r\n   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\r\n   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n   at Microsoft.AspNetCore.Hosting.Internal.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection exportServices)\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()\r\n   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()\r\n   at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()\r\n   at Globeport.Server.WebApi.Program.Main(String[] args) in D:\\Source\\Globeport\\Globeport.Server.WebApi\\Program.cs:line 15\r\n```"}}
{"actor":{"display_login":"globeport"}}