Can I determine what caused the build?

When Windows Setup starts with error "Error 1001. Unable to get Installer types in assembly MyService.exe". Therefore, it cannot load MyServiceInstaller. Registering Fusion shows me that it is not working when I try to locate the Data.dll assembly.

This is because you don't need to load Data.dll to create a service installation object. I thought that loading the type did not start until the method containing these types was called. Some of the MyServiceInstaller methods refer to data types from Data.dll, but not any ctor.

It is as if the action of loading MyService.exe or probing for MyServiceInstaller caused the Data.dll to load.

As I understand it, fusion magazine will not tell me what I need to know. It's too late at this point. I need to know if it is about loading MyServer.exe or probing for the MyServiceInstaller that caused the Data.dll to be loaded in the first place.

There is a business requirement that Data.dll cannot be placed next to MyService.exe. Indeed, this solves this problem. I have a custom AssemblyResolve event that loads Data.dll at normal runtime.

+2


source to share


2 answers


Try attaching a debugger to the installer and making it break when throwing an exception (you can set this in Visual Studio under Debug / Exceptions). Usually should be FileNotFoundException or something like that is reset in the Setup program when failure failure failure, which probably caught somewhere else, but if you make the debugger is broken when an exception is selected (and not when it is untreated) you can go in and get a stack trace, which should help you find out what exactly caused the problem.

You should see something like this in the stack trace:



  • [Uninteresting native and / or external code]

  • SomeClassInYourInstaller.SomeMethod() <-- this is the responsible method

  • SomeOtherStuff.SomeMethod()

  • ...etc...

+1


source


There may be a variable (field) of an instance of the type defined in Data.dll; when MyServiceInstaller is loaded, the types for all fields should be available even if they are not used, because the class is compiled if an instance is created.



0


source







All Articles