Fitnesse - Standard fitSharp configuration problem with .NET 4
Asked Answered
S

3

8

I have been using Fitnesse.NET for some time and am now attempting to upgrade to the newer fitSharp engine. I immediately ran into a roadblock though. Starting with a fresh system, I downloaded the latest fitnesse.jar and executed/installed it; all my test pages were then displaying fine from my browser.

The issue arises when I add configuration for fitSharp to the root page. I tried a variety of combinations of setting TEST_RUNNER and COMMAND_PATTERN; the end result was always that, upon executing any test, the fitnesse server never returned a result to my browser. For reference here is my root content, confirming these variable definitions are present and correct, at least according to this fitSharp configuration page:

variable defined: TEST_RUNNER=fitSharp\RunnerW.exe 
variable defined: COMMAND_PATTERN=%m -r fitnesse.fitserver.FitServer,fitSharp\fit.dll %p 

I finally found one troubleshooting note mentioning that RunnerW gives some diagnostic information so I switched to that and received this error message, indicating it is apparently an issue arising due to .NET 4:

Could not load file or assembly 'file:///C:\fitnesse\fitSharp\fit.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) File name: 'file:///c:\fitnesse\fitsharp\fit.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

The referenced MSDN page says that I need this in my config file:

<configuration>
   <runtime>
      <loadFromRemoteSources enabled="true"/>
   </runtime>
</configuration>

So it looks like I have three possibilities. Is there:

  1. An app.config or equivalent where I can insert that config section?
  2. A way to stop fitnesse from thinking that my local file is on a remote path?
  3. A way to enable CAS policy for the .NET framework?

Suggestions would be appreciated!

2010.01.17 Edit: I am using fit protocol rather than slim protocol in my environment.

Smalls answered 5/1, 2011 at 21:11 Comment(0)
S
3

I've never seen that before! Why does it think C: is a 'dangerous' network location? Anyway, the executable is Runner.exe (or RunnerW.exe) so if you create a Runner.exe.config with the settings above, it should pick it up.

Soliz answered 6/1, 2011 at 3:56 Comment(4)
Thanks, Mike, that succeeded. But then I ran smack into another issue that has apparently reared its head before: type DoFixture is not found (this is fitsharp v1.8 for .net 4.0). I will enter this as a separate question when I get a chance--unless you have a quick answer!Smalls
It's a bug - being fixed. Workaround is to add namespace fitlibrary to suite config file.Soliz
Can you clarify the fix for "DoFixture"? I don't understand what to do. Thank youGuibert
Create a suite config file fitsharp.github.com/FitSharp/SuiteConfigurationFile.html with something like this in it: <suiteConfig> <ApplicationUnderTest> <addNamespace>fitlibrary</addNamespace> </ApplicationUnderTest> </suiteConfig>Soliz
P
10

I know this has been answered but, imho there is a better resolution. If you 'unblock' fit.dll (right-click->properties->Unblock) you won't get the error. Happens due to downloaded files being locked by default.

Pires answered 4/5, 2011 at 4:36 Comment(0)
S
3

I've never seen that before! Why does it think C: is a 'dangerous' network location? Anyway, the executable is Runner.exe (or RunnerW.exe) so if you create a Runner.exe.config with the settings above, it should pick it up.

Soliz answered 6/1, 2011 at 3:56 Comment(4)
Thanks, Mike, that succeeded. But then I ran smack into another issue that has apparently reared its head before: type DoFixture is not found (this is fitsharp v1.8 for .net 4.0). I will enter this as a separate question when I get a chance--unless you have a quick answer!Smalls
It's a bug - being fixed. Workaround is to add namespace fitlibrary to suite config file.Soliz
Can you clarify the fix for "DoFixture"? I don't understand what to do. Thank youGuibert
Create a suite config file fitsharp.github.com/FitSharp/SuiteConfigurationFile.html with something like this in it: <suiteConfig> <ApplicationUnderTest> <addNamespace>fitlibrary</addNamespace> </ApplicationUnderTest> </suiteConfig>Soliz
T
0

visit this page

http://oweng.net/Visual-Studio-2010/Coded-UI-Fitnesse/integrating-coded-ui-and-fitnesse-fitsharp-slim-1.aspx

i was facing a similar issue but got resolved after visiting tjis page.

Trafficator answered 31/3, 2011 at 10:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.