持续集成,异常:nunit-console-x86.exe System.BadImageFormatException: 未能加载文件或程序集
来源:互联网 发布:开网店需要哪些软件 编辑:程序博客网 时间:2024/04/27 22:25
1 环境:
vs2010, NUnit2.5.5,CruiseControl.NET
2 症状:
Execution Runtime: net-2.0
Unhandled Exception:
System.BadImageFormatException: 未能加载文件或程序集“F:\SourceCode\FastQuery20161230\FastQueryTest\bin\Debug\FastQueryTest.dll”或它的某一个依赖项。生成此程序集的运行时比当前加载的运行时新,无法加载此程序集。
文件名:“F:\SourceCode\FastQuery20161230\FastQueryTest\bin\Debug\FastQueryTest.dll”
3 诊断:
首先需要移除项目中黄色的感叹号。在vs2010控制台使用如下命令
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exeF:\SourceCode\FastQuery20161230\FastQuery.sln,生成了dll文件。还是在vs2010控制台,再用nunit-console-x86.exe执行生成的dll抛出上面异常。
4 解决方案:
看来是版本问题。从http://download.csdn.net/download/linkedin_26236961/8464073下载Nunit-2.6.4.msi ,本地安装包位置:\\vmware-host\SharedFolders\F\软件安装包\单元测试\NUnit-2.6.4.msi
安装位置:
D:\NUnit 2.6.4\bin
再执行。
D:\Program Files (x86)\CruiseControl.NET\server下的配置文件ccnet.config改成如下:
<executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
<nunitpath="D:\NUnit2.6.4\bin\nunit-console-x86.exe">
ccnet.config配置文件内容:
<cruisecontrol>
<!-- This is yourCruiseControl.NET Server Configuration file. Add your projects below!-->
<projectname="FastQuery" >
<workingDirectory>E:\WorkSpace\SummerCourtyard\CVComponent20161213</workingDirectory>
<artifactDirectory>D:\Program Files(x86)\CruiseControl.NET\artifactDirectory</artifactDirectory>
<category>Library Category</category>
<webURL>http://localhost/ccnet/server/local/project/FastQuery/ViewProjectReport.aspx</webURL>
<modificationDelaySeconds>2</modificationDelaySeconds>
<triggers>
<intervalTriggerseconds="60"/>
</triggers>
<!--statetype="yourStateManagerType" ..=""/-->
<sourcecontroltype='svn'>
<!--url-->
<trunkUrl>https://win-9ris1mc6f8k/svn/SmartCode/SelfDefinitionQueryCMP</trunkUrl>
<!--svn-->
<executable>D:\Program Files\VisualSVN Server\bin\svn.exe</executable>
<workingDirectory>F:\SourceCode\FastQuery20161230</workingDirectory>
<!--svn-->
<username>cyberzhaohy</username>
<!--svn-->
<password>2319474</password>
<autoGetSource>true</autoGetSource>
</sourcecontrol>
<!--labellertype="dateLabeller"/-->
<!--prebuild>
<yourFirstPrebuildTask..=""/>
<yourOtherPrebuildTask..=""/>
</prebuild-->
<tasks>
<!---->
<!--Pass-->
<msbuild>
<!--msbuild-->
<executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
<!---->
<workingDirectory>F:\SourceCode\FastQuery20161230</workingDirectory>
<!--projectworkingDirectory,MSBuild-->
<projectFile>FastQuery.sln</projectFile>
<!---->
<buildArgs>/p:Configuration=Debug /v:diag</buildArgs>
<!--<buildArgs>/t:Build/p:Configuration=Release</buildArgs>-->
<!---->
<targets>Build</targets>
<!---->
<timeout>900</timeout>
<!--workingDirectory-->
<logger>D:\Program Files(x86)\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>
<nunitpath="D:\NUnit 2.6.4\bin\nunit-console-x86.exe">
<assemblies>
<assembly>F:\SourceCode\FastQuery20161230\FastQueryTest\bin\Debug\FastQueryTest.dll</assembly>
</assemblies>
</nunit>
</tasks>
<publishers>
<xmllogger />
</publishers>
<externalLinks>
<externalLinkname="google"url="http://somewhere/"/>
<externalLinkname="My Other Link"url="http://somewhere.else/"/>
</externalLinks>
</project>
</cruisecontrol>
现在持续集成已经没有问题。
NUnit 3.0之后每次发布不见得都有gui了。
参考网址:
http://www.th7.cn/Program/net/201312/165949.shtml
- 持续集成,异常:nunit-console-x86.exe System.BadImageFormatException: 未能加载文件或程序集
- 持续集成—nunit-console异常,未能加载文件或程序集“FastQueryTest”或它的某一个依赖项。系统找不到指定的文件。导致构建失败。
- system.badimageformatexception 未能加载文件或程序集
- system.badimageformatexception 未能加载文件或程序集
- 异常:System.BadImageFormatException,未能加载正确的程序集XXX或其某一依赖项
- 异常:System.BadImageFormatException,未能加载正确的程序集XXX或其某一依赖项
- 异常:System.BadImageFormatException,未能加载正确的程序集XXX或其某一依赖项。
- 异常:System.BadImageFormatException,未能加载正确的程序集XXX
- 异常:System.BadImageFormatException,未能加载正确的程序集XXX
- WCF部署时的异常错误“System.BadImageFormatException: 未能加载文件或程序集“GCGL_Service”或它的某一个依赖项。试图加载格式不正确的程序。”
- 安装服务时遇到 System.BadImageFormatException: 未能加载文件或程序集
- System.BadImageFormatException: 未能加载文件或程序集“Oracle.DataAccess”或它的某一个依赖项。试图加载格式不正确的程序。
- System.BadImageFormatException,未能加载正确的程序集XXX或其某一依赖项。。
- “System.BadImageFormatException”类型的未经处理的异常在 Castle.Windsor.dll 中发生 其他信息: 未能加载文件或程序集“Gis”或它的某一个依赖项。
- 异常详细信息: System.IO.FileLoadException: 未能加载文件或程序集
- 异常:System.IO.FileNotFoundException: 未能加载文件或程序集“Microsoft.mshtml
- 【异常】未能加载文件或程序集 (异常来自 HRESULT0x80131040)]
- 未能加载文件或程序集 system.web.extensions解决方法
- 我为何如此抵制考公务员
- 移植编译bcm sdk6.4.8 过程-平台arm-linux cortex-a9双核,系xilinx soc
- 端口镜像
- I am back
- Java线程池
- 持续集成,异常:nunit-console-x86.exe System.BadImageFormatException: 未能加载文件或程序集
- Handler的用法
- 什么是C++虚函数、虚函数的作用和使用方法
- Android空心圆角矩形按钮
- 文本分类入门(番外篇)特征选择与特征权重计算的区别
- Centos7 docker安装和操作实例
- MES核心模块功能设计
- Java并发编程的艺术(六)——线程间的通信
- HttpClient4.5.2版本中POST提交中文参数时乱码问题解决方法