Tag: F#

I was running the xUnit.gui.exe program to run units tests using xUnit… duh. Problem I ran into is that xUnit is not a part of the solution that the tests were. This caused issues when trying to run integration tests since the needed app.config wouldn’t be read by xUnit as the config file used when running an app is the config file from the topmost (Usually UI) project/application. So I made a wild guess that if I follow that logic, what little there may be, and add the connection strings to the xunit.gui.exe.config file as if it were an app.config/web.config, it should use the connection strings added… and turns out it did.

If you’re familiar with Func/Action, Linq, ect this might actually look a lot like some of the newer “functional like” additions to C#. Well at least the third one. Funny part, and I didn’t know this, is that most of the more interesting additions to C# (Generics, Linq, Lambda expressions) actually came from F#; Which was built to match other existing functional languages like Haskel)Â Go figure.

So ran into this while using XUnit (For my new F# adventure) and I ran into this error when I tried to use the XUnit.gui.exe thing:

“This assembly is built by a runtime newer that the currently loaded runtime and cannot be loaded.”

Pretty straightforward in that I am creating projects in 4.0 and one can infer XUnit wasn’t ready for this. At first I was thinking, painful as that is, that XUnit can’t handle 4.0. To my relief, I found this post at:

Great… except it only talks about the xunit.console.exe.config and there wasn’t a xunit.gui.exe.config. Well in a moment of questionable brilliance, more like a slight moment of clarity, I decided to copy the xunit.console.exe.config and rename the copied file to “xunit.gui.exe.config” and it worked. Go figure.