JasperFx / lamar

Fast Inversion of Control Tool and Successor to StructureMap
https://jasperfx.github.io/lamar
MIT License
568 stars 119 forks source link

Upgraded minor new exception with Scan->ThisCallingAssembly #171

Closed martea closed 5 years ago

martea commented 5 years ago

Upgraded minor new exception with Scan s ->s.ThisCallingAssembly() exception

System.IO.FileLoadException: 'The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)'

Stack trace:
   at System.Reflection.AssemblyName.nInit(RuntimeAssembly& assembly, Boolean raiseResolveEvent)
   at System.Reflection.AssemblyName..ctor(String assemblyName)

init of lamar

private static IWebHostBuilder CreateWebHostBuilder(string[] args)
        {
            var registry = new ServiceRegistry();
            registry.For<IConfiguration>().Use(GetConfiguration());

            registry.Scan(s =>
            {
                s.TheCallingAssembly();
                s.WithDefaultConventions();
            });

            return WebHost
                .CreateDefaultBuilder(args)
                .UseSerilog((hostingContext, loggerConfiguration) => loggerConfiguration
                    .ReadFrom.Configuration(GetConfiguration())
                    .Enrich.FromLogContext()
                    .WriteTo.Console())
                .UseLamar(registry)
                .UseSetting("https_port", "8080")
                .UseStartup<Startup>();
        }

Upgraded from to

   <PackageReference Include="Lamar" Version="3.0.3" />
-               <PackageReference Include="Lamar.Microsoft.DependencyInjection" Version="3.1.0" />
+               <PackageReference Include="Lamar" Version="3.0.4" />
+               <PackageReference Include="Lamar.Microsoft.DependencyInjection" Version="3.1.1" />
jeremydmiller commented 5 years ago

@martea I don't think this is a Lamar error. One way or another, you're missing some kind of .Net dependency in your app. Can you try a git clean -xfd and then recompile to see if that clears up?

jeremydmiller commented 5 years ago

No recent activity here