asp.net 网站运行时出错:IL 格式不正确
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------
IL 格式不正确。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.BadImageFormatException: IL 格式不正确。
源错误:
行 17: {
行 18: myweb s = new myweb();
行 19: SqlConnection conn = new SqlConnection(s.sqlconnstr());
行 20: try
行 21: {
源文件: e:\商务站\分类信息\数字人6.0\aaa.aspx 行: 19
堆栈跟踪:
[BadImageFormatException: IL 格式不正确。]
Shuziren.Data.myweb.sqlconnstr() +0
ASP.aaa_aspx.openmssql() in e:\商务站\分类信息\数字人6.0\aaa.aspx:19
ASP.aaa_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in e:\商务站\分类信息\数字人6.0\aaa.aspx:172
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +98
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.Page.Render(HtmlTextWriter writer) +26
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2558
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.1433; ASP.NET 版本:2.0.50727.1433
配置文件:
<connectionStrings>
<add name="sqlconnstr" connectionString="Data Source=127.0.0.1\sql2000;Initial Catalog=db_szr;Persist Security
Info=False;User ID=sa;Password=sa" providerName="System.Data.SqlClient"/>
</connectionStrings>
因为我的机器上同时装了sql2000和sql2005,所以是用的都是命名实例computer\sql2000。把字符串改为Data Source=computer\sql2000或者Data Source=(local)\sql2000,在.net1.1,2.0下都不行,网上也搜不到答案。实在没辙了,求各位同仁帮助