LibZ icon indicating copy to clipboard operation
LibZ copied to clipboard

Impossible to inject Nancy.dll, in any scenario from 1 to 4

Open pavelvr opened this issue 6 years ago • 1 comments

Hi, I'm using NancyFx, but Nancy.dll fails to load. I've tried evey scenario, from 1 to 4, and every other .dll is ok, but Nancy.dll. I'm using LibZ Tool 1.2 and Nancy 1.4.2. Even other Nancy .dlls are ok, no problem (Nancy.Authentication.Forms.dll, Nancy.Gzip.dll, Nancy.Hosting.Self.dll), nor even get loaded with --safe-load.

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Nancy, Version=1.4.2.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
   at Skelf.App.FormsAuthBootstrapper.ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
   at Nancy.Bootstrapper.NancyBootstrapperBase`1.Initialise()
   at Nancy.Hosting.Self.NancyHost..ctor(INancyBootstrapper bootstrapper, HostConfiguration configuration, Uri[] baseUris)
   at Nancy.Hosting.Self.NancyHost..ctor(Uri[] baseUris)
   at Skelf.App.Skelf.Main()

Right now, I have my .exe, with every .dll embedded using scenario 1, and just Nancy.dll along the .exe file.

Thanks in advance

PS: The application is getting compiled on Windows 10, with .NET 4.5.2, ToolsVersion 4.0, AnyCPU

pavelvr avatar Aug 17 '18 16:08 pavelvr

The quick answer is: I don't know. This whole approach is based on hijacking AssemblyNotFound (not actual name) event. It actually starts with NOT finding things. It also seems that the problem is in Skelf.App.FormsAuthBootstrapper.ApplicationStartup. Maybe it is IoC container? Maybe Nancy, Version=1.4.2.0, Culture=neutral, PublicKeyToken=null does not match assembly which is actually included. If you can create a isolated example which I could debug maybe I could take a look what is actually happening.

MiloszKrajewski avatar Aug 28 '18 12:08 MiloszKrajewski