当前位置:编程学习 > C#/ASP.NET >>

一个十分皈依可怕的问题 , 请教大家

写了一个c#得小项目(本项目中用到了别的程序所产生的dll),然后再本机器ctrl + f5运行,一些正常,但是把它publish到IIS上面,想起他机器也可以访问,却出现了如下的错误;

/////////////////////////////////////////////////////////////////////////
Server Error in '/' Application.
---------------------------------------------------------------------------

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

Source Error: 


Line 176:            //     </categorylist>
Line 177:            // </querycategory>"
Line 178:            ret = GetCategories(p, text);
Line 179:
Line 180:            return ret;
 

Source File: D:\zsli\projects\WebProject\QueryClassifier\QueryClassifier\App_Code\QueryClassifier.cs    Line: 178 

Stack Trace: 


[BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)]
   Columbus.QueryClaasifier.Classifier.GetCategories(IntPtr p, String text) +0
   Columbus.QueryClaasifier.Classifier.GetCategoryResultString(String text) in D:\zsli\projects\WebProject\QueryClassifier\QueryClassifier\App_Code\QueryClassifier.cs:178
   Columbus.QueryClaasifier.Classifier.ClassifyQuery(String query) in D:\zsli\projects\WebProject\QueryClassifier\QueryClassifier\App_Code\QueryClassifier.cs:58
   QueryClassifier._Default.QueryClassiferExecute(String cString) in D:\zsli\projects\WebProject\QueryClassifier\QueryClassifier\Default.aspx.cs:47
   QueryClassifier._Default.Page_Load(Object sender, EventArgs e) in D:\zsli\projects\WebProject\QueryClassifier\QueryClassifier\Default.aspx.cs:85
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +58
   System.Web.UI.Control.OnLoad(EventArgs e) +127
   System.Web.UI.Control.LoadRecursive() +101
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2588

/////////////////////////////////////////////////////////////////////////

但是程序是一摸一样的阿,在本机器上面跑的如此正常,怎么我发布在IIS上面就有这样的异常错误: (Exception from HRESULT: 0x8007000B)    ??
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

小弟,搞了一天多了,身心疲惫了,麻烦大家帮忙一下,超级谢谢大家了 --------------------编程问答-------------------- 可能原因是没有设置虚拟目录... --------------------编程问答-------------------- 什么意思? 可否详细一点 --------------------编程问答-------------------- 异常信息很明显就是程序有错!

BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)]

错误图片格式异常!!!

错误源
Source Error: 

Line 176:            //     </categorylist>
Line 177:            // </querycategory>"
Line 178:            ret = GetCategories(p, text);
Line 179:
Line 180:            return ret;
 

Source File: D:\zsli\projects\WebProject\QueryClassifier\QueryClassifier\App_Code\QueryClassifier.cs    Line: 178 

GetCategories(p, text); // 获取类别,怎么与图片有关系?LZ 仔细查代码吧!
--------------------编程问答--------------------
引用 3 楼  的回复:
异常信息很明显就是程序有错!

BadImageFormatException:   An   attempt   was   made   to   load   a   program   with   an   incorrect   format.   (Exception   from   HRESULT:   0x8007000B)]

错误图片格式异常!!!

错误源
……


1. 建议你多学学32/64位操作系统
2. 多学学英语
3. 不要不懂装懂,在论坛上胡扯 --------------------编程问答-------------------- 你本机是怎么调用dll的?

你本机没有用IIS调用?IIS的权限控制有限制的。

还有,你的IIS运行在什么环境下,你的机子是什么环境,IIS是什么环境? --------------------编程问答-------------------- 直接可以在IIS上面调试的,可能是权限的问题,禁止访问某些资源,
--------------------编程问答-------------------- 比如dll如果访问文件,如果是桌面程序,直接就可以访问,但挂到iis上面,就不行了,因为iis 的权限弱得多
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,