"Illegal characters in path" trying to run any sample installer

Nov 22, 2016 at 8:52 AM
Hello, thank you for creating and sharing this project.

I downloaded WixSharp. today, uncompressed it and am trying to follow your tutorial, but cannot get any of the samples to work. I also tried to use the Visual Studio project template to create a new "WixSharp Setup" project, but I can't get that to work either.

I set the environment-variable WIXSHARP_WIXDIR to C:\Program Files (x86)\WixSharp.\Wix_bin\bin

When I open a DOS window and go to, for example, your sample program ProductInfo, and enter

it says..

C# Script execution engine. Version
Error: Specified file could not be executed.
System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(string path, Boolean checkAdditional)
at Script.Main(String[] args)

What have I done wrong? !!

Thank you for your time and help,
James W. Hurst
JamesH@Designforge.com I am running Windows 10 x64, and using Visual Studio 2015
Nov 22, 2016 at 11:26 AM
Edited Nov 28, 2016 at 7:10 AM
Typically Wix# compiler is capable of finding WiX installation even without relying on WIXSHARP_WIXDIR variable. Though if this for whatever reason is not happening using VS templates is arguably a better option to start the troubleshooting with.

This is what you can do.
  1. Create a fresh project from "WixSharp Setup" template.
  2. In package management console execute install-package WixSharp
  3. In package management console execute install-package WixSharp.wix.bin
  4. In the code, assign Compiler.WixLocation to the location of the WiX bin (either relative or absolute)
//DON'T FORGET to execute "install-package wixsharp" in the package manager console
Compiler.WixLocation = @"..\packages\WixSharp.wix.bin.3.10.1\tools\bin";
Let me know it it worked for you.
Nov 27, 2016 at 8:00 PM
Following your steps exactly, got me past this hurdle. Thank you!