lefthandedgoat / canopy

f# web automation and testing library, built on top of Selenium (friendly to c# also)
http://lefthandedgoat.github.io/canopy/
MIT License
506 stars 115 forks source link

Embedding canopy fails in configuration.fs #442

Open TheGoddessInari opened 6 years ago

TheGoddessInari commented 6 years ago

If you embed canopy into the resulting assembly (such as with Fody.Costura), it fails on line 7 of configuration.fs, when it takes the reference assembly location.

This fairly well violates the principle of least surprise, as you'd expect canopy to be embeddable and only need two executables (the application executable and the webdriver).

lefthandedgoat commented 6 years ago

Fails in what way? Fails to embed?

TheGoddessInari commented 6 years ago
The type initializer for '<StartupCode$canopy>.$canopy.configuration' threw an exception. ---> System.ArgumentException: The path is not of a legal form.
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.InternalGetDirectoryName(String path)
   at <StartupCode$canopy>.$canopy.configuration..cctor() in C:\projects\canopy\src\canopy\configuration.fs:line 7
   --- End of inner exception stack trace ---

At runtime. It raises an exception when embedded.

lefthandedgoat commented 6 years ago

It looks like the location of the assembly is lost because it is embedded.

https://github.com/Fody/Costura/issues/180