Ok I've worked out a solution....

In Visual Studio the app.config file appears to get renamed to 
YourAppFilename.exe.config when the project is compiled. It's necessary to 
redistribute the YourAppFilename.exe.config file when it contains unusual 
settings like useLegacyV2RuntimeActivationPolicy="true". My installer was not 
copying the YourAppFilename.exe.config file consequentially the ServiceInstall 
was failing as it was not using the useLegacyV2RuntimeActivationPolicy 
configuration setting. Of course it's not necessary to redistribute the 
YourAppFilename.exe.config file if your app is happy with the default settings.

Regards

Andrew


----------------------------------------
 From: "Andrew Jones" <andrew.jo...@alquist.co.uk>
Sent: Wednesday, July 03, 2013 4:27 PM
To: "wix-users@lists.sourceforge.net" <wix-users@lists.sourceforge.net>
Subject: [WiX-users] ServiceInstall fails when installing service containing a 
Mixed Mode dll

I have a .NET 4 Windows Service that references a Mixed Mode .NET2.0/3.5 dll. 
In my Windows Service application I've had to alter app.config to add a 
useLegacyV2RuntimeActivationPolicy="true" to allow use of the legacy dll.

<startup useLegacyV2RuntimeActivationPolicy="true">

I can install and start this service manually from a command prompt using the 
.NET 4.0 "InstallUtil filename.exe". However the Wix ServiceInstall element 
fails to install the service resulting in an Event Log entry saying " Service 
cannot be started. System.IO.FileLoadException: Mixed mode assembly is built 
against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 
runtime without additional configuration information."

If I remove the reference to the .NET 2.0/3.5 Mixed mode dll from my service 
everything installs with WIX just fine.

Any idea how I can get the Wix ServiceInstall to work?

Regards,

Andrew Jones,

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to