【问题标题】:ASP.net deployment assembly errorASP.net 部署程序集错误
【发布时间】:2013-03-08 18:21:30
【问题描述】:

我在将 ASP.NET 项目部署到我们的服务器时遇到问题。

Web.config:

    <?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <!--For crystal Report-->
  <configSections>
    <sectionGroup name="businessObjects">
      <sectionGroup name="crystalReports">
        <section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null" />
        <section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler" />
      </sectionGroup>
    </sectionGroup>
  </configSections>
  <businessObjects>
    <crystalReports>
      <rptBuildProvider>
        <add embedRptInResource="true" />
      </rptBuildProvider>
      <crystalReportViewer>
        <add key="ResourceUri" value="/crystalreportviewers13" />
      </crystalReportViewer>
    </crystalReports>
  </businessObjects>
  <appSettings>
    <add key="CrystalImageCleaner-AutoStart" value="true" />
    <add key="CrystalImageCleaner-Sleep" value="60000" />
    <add key="CrystalImageCleaner-Age" value="120000" />
    <!--For crystal Report-->
  </appSettings>
  <connectionStrings>
    <clear />        

    <add name="EB_WebProjectEntities" connectionString="metadata=res://*/ClassModel.Database.EB_WebProject.csdl|res://*/ClassModel.Database.EB_WebProject.ssdl|res://*/ClassModel.Database.EB_WebProject.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=NATE-PC\SQLEXPRESS2008;initial catalog=EB_NEW;user id=user1;password=user;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
    <add name="EB_NEWConnectionString" connectionString="Data Source=NATE-PC\SQLEXPRESS2008;Initial Catalog=EB_NEW;Persist Security Info=True;User ID=user1;Password=user" providerName="System.Data.SqlClient" />    

    <!--<add name="EB_WebProjectEntities" connectionString="metadata=res://*/ClassModel.Database.EB_WebProject.csdl|res://*/ClassModel.Database.EB_WebProject.ssdl|res://*/ClassModel.Database.EB_WebProject.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=KOO-PC\SQLEXPRESS;initial catalog=EB_NEW;user id=user1;password=user;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
    <add name="EB_NEWConnectionString" connectionString="Data Source=KOO-PC\SQLEXPRESS;Initial Catalog=EB_NEW;Persist Security Info=True;User ID=user1;Password=user" providerName="System.Data.SqlClient" />-->        

  </connectionStrings>
  <!--Koo Testing Server-->
  <system.web>
    <customErrors mode="Off" defaultRedirect="~/Module/SharedPage/ErrorPage.aspx">
      <error statusCode="403" redirect="~/Module/SharedPage/ErrorPage.aspx" />
      <error statusCode="404" redirect="~/Module/SharedPage/ErrorPage.aspx" />
    </customErrors>
    <httpHandlers>
      <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
      <add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
    </httpHandlers>
    <pages enableSessionState="true" />
    <httpRuntime executionTimeout="86400" />
    <!--set the default time format to Malaysia (Koo-8/3/2011)-->
    <globalization culture="en-MY" uiCulture="en" responseEncoding="utf-8" />
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.ReportAppServer.DataDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
        <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
        <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
        <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
        <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
      </assemblies>
      <buildProviders>
        <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      </buildProviders>
    </compilation>
    <authorization>
      <allow users="*" />
    </authorization>
    <membership>
      <providers>
        <clear />
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
      </providers>
    </membership>
    <profile>
      <providers>
        <clear />
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
      </providers>
    </profile>
    <roleManager enabled="false">
      <providers>
        <clear />
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
      </providers>
    </roleManager>
    <!--HTTPMODULE Part-->
    <httpModules>
      <add name="ValidateUser" type="BLClass.BLCommon.HMValidateType" />
    </httpModules>
    <!--HTTPMODULE Part-->
  </system.web>
  <system.web.extensions>
    <scripting>
      <scriptResourceHandler enableCompression="true" enableCaching="true" />
    </scripting>
  </system.web.extensions>
  <system.webServer>
    <modules>
      <add name="ValidateUser" type="BLClass.BLCommon.HMValidateType" preCondition="" />
    </modules>
    <handlers>
      <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode" />
    </handlers>
    <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>
</configuration>

这是我得到的错误

Parser Error Message: 
Could not load file or assembly 'System.Design, Version=4.0.0.0, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Could not load file or assembly 'CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.

crystaldecision 相关的所有程序集都会抛出上述错误。谁有解决方案?我使用的是window server 2008。

【问题讨论】:

  • 你的bin文件夹中有这些DLL吗?
  • 第 1 步,在您的生产服务器上,确保文件已实际安装。
  • 是的。我的 bin 文件夹中有这些 dll。我尝试部署我的 localhost 。它可以运行。但部署到其他服务器。它给出了错误
  • 明确一点,生产机器的bin文件夹里有文件吗?
  • 嗨,是的。它存在于 bin 文件夹中

标签: c# asp.net deployment .net-assembly


【解决方案1】:

您需要在服务器上安装 Crystal Reports redist。这篇 SO 文章有一些很好的解释和下载链接Crystal Reports 13 And Asp.Net 3.5

【讨论】:

  • 嗨,我尝试安装水晶报表。但我得到“你必须已经安装了 VS 2010 才能继续这个安装”
  • 这两个 zip 文件包含重新分发(你需要这个)。 .exe 是 Visual Studio 的附加组件。 (在服务器上不好)
【解决方案2】:

如果您要部署到 64 位计算机,则需要在运行您的网站的应用程序池中启用 32 位应用程序。据我所知,Log4net 是 32 位 dll。

您可以在应用程序池设置中看到this question

【讨论】:

  • 嗨,在我的应用程序池中,我已经将启用 32 位设置为 true
  • 您是否在服务器上安装了 Crystal Reports redist,正如@tgolisch 在他的回答中提到的那样?我忘记了,你也需要这样做。
  • 你在服务器上安装了.net 4.0,你有没有设置应用程序池为.net 4.0?
  • 是的。我已将应用程序池设置为 4.0,并尝试安装水晶报告。但我得到“你必须已经安装了 VS 2010 才能继续安装”
  • 那么我认为您正在尝试安装 vs 插件而不是可再发行组件。
猜你喜欢
  • 2012-10-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多