Fitnesse加载DLL的问题(Fitnesse problems loading dll)
我在加载that.dll包含调用my work的测试类时遇到问题。
我可以用helloworld.dll做得很好但是当我把helloworld测试放在我的test.dll中时,即使我从test.dll中删除了我的work.dll引用,也无法加载
我认为她的问题是,Fitness不知道work.dll的路径,我该如何指定呢? (优先在根页面)
我得到的错误信息是:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\Projects\..\test.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. File name: 'file:///C:\Projects\..\test.dll' at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) at System.Reflection.Assembly.LoadFrom(String assemblyFile) at fitSharp.Machine.Engine.CurrentDomain.LoadAssembly(String assemblyPath) at fitSharp.Machine.Engine.ApplicationUnderTest.Assemblies.AddAssembly(String assemblyName) at fitSharp.Machine.Engine.ApplicationUnderTest.AddAssemblies(IEnumerable`1 assemblyNames) at fitnesse.fitserver.FitServer.ParseCommandLineArguments(IEnumerable`1 args) at fitnesse.fitserver.FitServer.Run(IList`1 CommandLineArguments) at fitnesse.fitserver.FitServer.Run(IList`1 commandLineArguments, Memory memory, ProgressReporter reporter) at fitSharp.Machine.Application.Shell.Run() at fitSharp.Machine.Application.Shell.Execute() at fitSharp.Machine.Application.Shell.Run(IList`1 commandLineArguments) === Pre-bind state information === LOG: User = kenneth LOG: Where-ref bind. Location = C:\Projects\..\test.dll LOG: Appbase = file:///C:/Projects/fitnesse/dotnet2/ LOG: Initial PrivatePath = NULL Calling assembly : (Unknown). === LOG: This bind starts in LoadFrom load context. WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load(). LOG: Using application configuration file: C:\Projects\fitnesse\dotnet2\Runner.exe.Config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config. LOG: Attempting download of new URL file:///C:/Projects/../test.dll. ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
有没有人有任何线索/提示。
谢谢肯尼斯
I am having trouble loading the that.dll contains my test classes that call into my work.dll.
I can do it nicely with a helloworld.dll but when I put the helloworld test in my test.dll, It cannot load, even after I remove my work.dll references from the test.dll
I think the problem her is that the path to the work.dll is not known by Fitness, how do I specify it? ( preferebly in the root page)
the error messages I get are:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\Projects\..\test.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. File name: 'file:///C:\Projects\..\test.dll' at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) at System.Reflection.Assembly.LoadFrom(String assemblyFile) at fitSharp.Machine.Engine.CurrentDomain.LoadAssembly(String assemblyPath) at fitSharp.Machine.Engine.ApplicationUnderTest.Assemblies.AddAssembly(String assemblyName) at fitSharp.Machine.Engine.ApplicationUnderTest.AddAssemblies(IEnumerable`1 assemblyNames) at fitnesse.fitserver.FitServer.ParseCommandLineArguments(IEnumerable`1 args) at fitnesse.fitserver.FitServer.Run(IList`1 CommandLineArguments) at fitnesse.fitserver.FitServer.Run(IList`1 commandLineArguments, Memory memory, ProgressReporter reporter) at fitSharp.Machine.Application.Shell.Run() at fitSharp.Machine.Application.Shell.Execute() at fitSharp.Machine.Application.Shell.Run(IList`1 commandLineArguments) === Pre-bind state information === LOG: User = kenneth LOG: Where-ref bind. Location = C:\Projects\..\test.dll LOG: Appbase = file:///C:/Projects/fitnesse/dotnet2/ LOG: Initial PrivatePath = NULL Calling assembly : (Unknown). === LOG: This bind starts in LoadFrom load context. WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load(). LOG: Using application configuration file: C:\Projects\fitnesse\dotnet2\Runner.exe.Config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config. LOG: Attempting download of new URL file:///C:/Projects/../test.dll. ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
Does anyone have any clues/tips.
thanks kenneth
原文:https://stackoverflow.com/questions/17747567
最满意答案
我不知道您使用的是哪种编程语言,但我将使用PHP Laravel和AngularJS给您一个示例。
API
Route::get('/api/users', function () { $users = App\User::all(); return $users; }); Route::get('/api/users/admin', function () { $users = App\User::where('admin', true)->get(); return $users; });
面前
angular.module('app', []) .service('api', ['$http', function ($http) { function getUsers() { return $http.get('/api/users'); } function getAdminUsers() { return $http.get('/api/users/admin'); } this.getUsers = getUsers; this.getAdminUsers = getAdminUsers; }]) .controller('UserCtrl', ['$scope', 'api', function ($scope, api) { $scope.users = []; $scope.adminUsers = []; api.getUsers() .then(function success(response) { $scope.users = response.data; }, function error(response) { }); api.getAdminUsers() .then(function success(response) { $scope.adminUsers = response.data; }, function error(response) { }); }]);
Sorry about the lack of details in my question. I was actually asking the question about the angular-restmod module.
Here's what I did in the end:
module.factory('CustomMethods', ['restmod', 'RMUtils', function CustomMethodsMixin(restmod, RMUtils) { return restmod.mixin(function() { this.define('Model.$customCollection', function(_url, params) { var original = this; return this.$collection(params, { $urlFor: function() { return RMUtils.joinUrl(original.$url(), _url); } }); }); return this; }); }]);
And expose all my api to it:
restmodProvider.rebase('CustomMethods')
相关问答
更多-
扩展的SqlProfileProvider,如何调用我的自定义方法?(Extended SqlProfileProvider, how do I call my custom method?)[2023-09-15]
我通过反复试验找到了解决方案: ((MySqlProfileProvider)ProfileBase.Properties["ANY_PROFILE_PROPERTY"].Provider).ChangeConnectionString(sRequiredData); I found the solution by trial and error: ((MySqlProfileProvider)ProfileBase.Properties["ANY_PROFILE_PROPERTY"].Provider) ... -
你必须扩展该类并覆盖该方法,如果它是公共的..但在它之前读取它的javadoc如果它是可用的.. You have to extend that class and override that method if it is public..but before doing it read its javadoc if it is vailanble..
-
在下面的例子中,我假设你的模型叫做Greeter ,静态方法Greeter.greet是通过GET /greeters/greet?name=Alex调用的。 首先,您需要描述方法的REST映射。 然后,您可以使用invokeMethod调用该方法。 public class GreeterRepository extends ModelRepository
{ public RestContract createContract() { RestContract co ... -
你可以实例化它: public static class HtmlExtensions { public static MvcHtmlString Foo(this HtmlHelper htmlHelper) { var ajaxHelper = new AjaxHelper(htmlHelper.ViewContext, htmlHelper.ViewDataContainer); var form = ajaxHelper.BeginForm(); ...
-
你可以像这样创建一个自定义的ViewAction public class MyCustomViewAction implements ViewAction{ @Override public Matcher
getConstraints(){ return isAssignableFrom(YourCustomView.class); } @Override public String getDescription(){ ... -
我建议把它移到你的模型: question.rb def self.ping question = Question.first question.update(:amplify => question.amplify + 1) end 并定义自定义路由, routes.rb post '/ping' => 'questions#ping', as: 'ping' questions_controller.rb def ping Question.ping end 然后你可以从控制台引用 ...
-
要访问自定义属性的视图模型,只需将自定义属性第二次放在元素上,但这次将.ref="viewModelPropertyName"放到属性上。 然后,在父视图模型中,您可以使用viewModelPropertyName (或您给它的任何名称)访问该属性的方法。 你可以在这里看到一个例子: https : //gist.run/?id = 9819e9bf73f6bb43b07af355c5e166ad app.htmlModel.save的第一个参数是您希望修改的属性的散列,选项是第二个并保存成功/错误回调。 尝试 this.model.save({}, { success: function() { console.log('save success'); } }); 在工作中看到这个小提琴http://jsfiddle.net/nikoshr/XwfTB/ The first argument to Model.save is a hash of attributes you wis ...
如何调用自定义get方法(How do I call a custom get method)[2022-04-18]
我不知道您使用的是哪种编程语言,但我将使用PHP Laravel和AngularJS给您一个示例。 API Route::get('/api/users', function () { $users = App\User::all(); return $users; }); Route::get('/api/users/admin', function () { $users = App\User::where('admin', true)->get(); return $ ...Objective-C中的两个神奇概念是委托和通知 。 委派允许您将控制器挂钩到单元格中引用的弱对象,这可以避免保留周期,同时仍允许您向其发送消息。 通知允许您的Cell向任何处于活动状态并正在侦听它的类广播通用通知。 选择一个,以最简单的方式,坚持下去。 在这种情况下,两者基本相同。 Two magical concepts in Objective-C are Delegation and Notifications. Delegation allows you to have your control ...相关文章
更多- “应用程序或DLL C:\WINDOWS\system32\PNCRT.dll为无效的windows映像”的解决方法
- Solr安装异常:SolrException: Error loading class 'solr.VelocityResponseWriter'
- maven项目使用SOLR时报 previously initiated loading for a different type with name "javax/servlet/http/HttpServletRequest" 错的解决方法
- 卸载常用组件
- java类加载机制的过程
- Hadoop Real-World Solutions Cookbook
- 【转】异步加载图片,使用LruCache和SD卡或手机缓存,效果非常的流畅
- hibernate延迟加载
- 类加载方法
- C++(调用java代理)要跨平台通讯用的什么技术?
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。