这几天为了给客户演示我们的项目,发现原来程度在开发环境和部署环境中还不太一样,原本在开发环境中程度运行的好好的,而部署后装在服务器则可能产生不少的错误。因此记录下所遇到的问题,方便以后查询同时也希望能帮遇到相关问题的朋友尽快解决问题或者避免这类的问题出现,经过google,baidu后得出一些相关的结论:
一、 如果你的程度用到水晶报表,那就需要为服务器部署所需要的环境或程序集,否则部署后程序会出现以下错误:
Configuration Error
Description:
An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below
and
modify your configuration file appropriately.
Parser Error
Message:
Could
not
load file
or
assembly
'
CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
'
or
one of its dependencies. 系统找不到指定的文件。
Source
Error:
Line
85
: </pages>
Line
86
: <httpHandlers>
Line
87
: <
add
verb=
"
GET
"
path=
"
CrystalImageHandler.aspx
"
type=
"
CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
"
/>
Line
88
: </httpHandlers>
Line
89
: <sessionState timeout=
"
360
"
></sessionState>
Source
File:
c:
\inetpub\wwwroot\yuexiusf\web.config
Line:
87
Assembly Load
Trace:
The following information can be helpful to determine why the assembly
'
CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
'
could
not
be loaded.
WRN:
Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to
1
.
Note:
There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
--------------------------------------------------------------------------------
Version
Information:
Microsoft .NET Framework
Version:
2
.
0
.
50727
.
42
;
ASP.NET Version:2.0.50727.42
解决方法:
1、在你的开发环境中找到Visual Studio安装目录下的\
SDK\v2.0\BootStrapper\Packages\CrystalReports,将安装文件CRRedist2005_x86.msi,复制到服务器中并安装。
2、如果程序还不能运行,需要将水晶报表的五个dll文件复制到你的网站下的bin目录,其五大将的名称如下:
CrystalDecisions.CrystalReports.Engine.dll
CrystalDecisions.ReportSource.dll
CrystalDecisions.Shared.dll
CrystalDecisions.Web.dll
CrystalDecisions.Windows.Forms.dll
那么他们身在何处呢?答:“在你的开发环境中C:\Program Files\Common Files\Business Objects\2.7\Managed\目录下”
二、如果你的项目中用了excel或者word编程时,可能会出现以下错误:
Could
not
load file
or
assembly
'
Microsoft.Office.Interop.Word
'
Parser Error
Message:
Could
not
load file
or
assembly
'
Microsoft.Office.Interop.Word, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
'
or
one of its dependencies. The system cannot find the file specified.
Source
Error:
Line
27
: <compilation debug=
"
false
"
>
Line
28
: <assemblies>
Line
29
: <
add
assembly=
"
Microsoft.Office.Interop.Word, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
"
/>
Line
30
: <
add
assembly=
"
Office, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
"
/>
Line
31
:
解决方法:
1、 网上说在
http://www.microsoft.com/downloads/details.aspx?FamilyId=3C9A983A-AC14-4125-8BA0-D36D67E0F4AD&displaylang=en,下载个
O2003PIA.EXE文件安装就行了,但我试了还是不行,或许我没有留心看其解决的方法,知道的同志麻烦说一声。
2、后来我干脆在服务上装上了office2003,问题就问题就搞定了(虽然这样做不是很好)
三、关于登录页面的命名,如果你的页面中有个叫login.aspx的话,网站部署后可能会出现这样的错误 :
Server Error
in
'
/XX
'
Application.
--------------------------------------------------------------------------------
Compilation Error
Description:
An error occurred during the compilation of a resource required to service this request. Please review the following specific error details
and
modify your source code appropriately.
Compiler Error
Message:
CS0030:
Cannot convert type
'
ASP.login_aspx
'
to
'
System.Web.UI.WebControls.Login
'
Source
Error:
Line
112
: public login_aspx() {
Line
113
: string[] dependencies
;
Line
114
: ((Login)(this)).AppRelativeVirtualPath =
"
~/login.aspx
"
;
Line
115
: if ((
global:
:ASP.login_aspx.@__initialized == false)) {
Line
116
: dependencies = new string[
1
]
;
Source
File:
c:
\WINDOWS\Microsoft.NET\Framework\v2.
0
.
50727
\Temporary ASP.NET Files\XX\d41012e3\4462d393\App_Web_login.aspx.cdcab7d2.ip6y7oyd.
0
.cs
Line:
114
原因:
这是因为.net2.0中有一个叫login的控件,这样.netframework就不知道她应该选择哪个好,把你的的页面强制转换成她内置的控件,就出错了。
解决方法:
1、不要取login这样的页面名称
2、如果你不想改页面的名称,在其cs文件中加上命名空间,或者改其class Name如改成“User_Login”,最后不要忘了在aspx页面中改其引用如:
<%
@ Page Language
=
"
C#
"
AutoEventWireup
=
"
true
"
CodeFile
=
"
Login.aspx.cs
"
Inherits
=
"
User_Login
"
%>
如果你通过以上的方法还解决不了,提议打开C:\WINDOWS\assembly
看看相应的程序集的version是不是对上号了
还有……
遇到时加上~~
四、未在本地计算机上注册“Microsoft.Jet.OleDb.4.0”提供程序
五、未能加载文件或程序集 XX 或它的某一个依赖项
转载请注明出处[http://samlin.cnblogs.com]