Fitnesse - .NET 4 的标准 fitSharp 配置问题

发布于 2024-10-10 21:12:52 字数 1691 浏览 0 评论 0原文

我已经使用 Fitnesse.NET 一段时间了,现在正在尝试升级到更新的 fitSharp 引擎。但我立即遇到了障碍。从一个新的系统开始,我下载了最新的fitnesse.jar并执行/安装它;然后我的所有测试页面都在我的浏览器中显示良好。

当我将 fitSharp 的配置添加到根页面时,出现了问题。我尝试了设置 TEST_RUNNER 和 COMMAND_PATTERN 的各种组合;最终结果始终是,在执行任何测试时,fitnesse 服务器从未向我的浏览器返回结果。这里供参考的是我的根内容,至少根据此 fitSharp 确认这些变量定义存在且正确配置页面

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

我终于找到了一个故障排除说明 提到 RunnerW 提供了一些诊断信息,因此我切换到该信息并收到此错误消息,表明这显然是由于 .NET 4 引起的问题:

无法加载文件或程序集 '文件:///C:\fitnesse\fitSharp\fit.dll' 或其依赖项之一。手术 不支持。 (例外情况来自 HRESULT:0x80131515)文件名: '文件:///c:\fitnesse\fitsharp\fit.dll' ---> System.NotSupportedException:尝试加载程序集 从网络位置 导致大会 在以前版本的沙盒中 .NET框架。此次发布的 .NET Framework 不启用 CAS 默认策略,所以这个负载可能是 危险的。如果这个负载不是 旨在对程序集进行沙箱处理, 请启用 loadFromRemoteSources 开关。看 http://go.microsoft.com/fwlink/?LinkId=155569 了解更多信息。

引用的 MSDN 页面说我在配置文件中需要这个:

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

所以看起来我有三种可能性。是否有:

  1. app.config 或等效文件,我可以在其中插入该配置部分?
  2. 有办法阻止fitnesse认为我的本地文件位于远程路径上吗?
  3. 为 .NET 框架启用 CAS 策略的方法?

如有建议,将不胜感激!

2010.01.17 编辑:我在我的环境中使用的是 fit 协议而不是 slim 协议。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

妖妓 2024-10-17 21:12:52

我知道这个问题已经得到解答,但是,恕我直言,还有更好的解决方案。如果您“取消阻止”fit.dll(右键单击->属性->取消阻止),您将不会收到错误。由于默认情况下下载的文件被锁定而发生。

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.

夜清冷一曲。 2024-10-17 21:12:52

我以前从未见过!为什么它认为 C: 是“危险”网络位置?无论如何,可执行文件是 Runner.exe(或 RunnerW.exe),因此如果您使用上述设置创建 Runner.exe.config,它应该会选择它。

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.

围归者 2024-10-17 21:12:52

访问此页面

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

我遇到了类似的问题,但是访问tjis页面后得到解决。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文