Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fitnesse - Standard fitSharp configuration problem with .NET 4

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.

like image 633
Michael Sorens Avatar asked Jan 05 '11 21:01

Michael Sorens


2 Answers

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.

like image 178
timDunham Avatar answered Oct 21 '22 22:10

timDunham


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.

like image 41
Mike Stockdale Avatar answered Oct 21 '22 21:10

Mike Stockdale