2015-02-24 93 views
1

好吧,我已經嘗試了互聯網上提到的一切。我在VS 2013 Express for Web中完成了我的大部分項目。由於它不支持Crystal Reports,我恢復爲VS2012 Ultimate。它開啓瞭解決方案,並且工作得很好。我遇到的麻煩是當我嘗試添加報告時,它會通過命名部分,當它要加載報告頁面時,它會給我以下錯誤:ErrorLink。 我的工具包在VS2013上工作正常。 工具包版本:7.1213 AjaxMin:4.97 HtmlAglilityPack:1.4.9無法加載文件或程序集HtmAgilityPack verion 1.4.6.0

我在這裏給我的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> 
    <configSections> 
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> 
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 

    </configSections> 
    <connectionStrings> 
    <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-SMC-20141224085758.mdf;Initial Catalog=aspnet-SMC-20141224085758;Integrated Security=True" providerName="System.Data.SqlClient" /> 
    <add name="masterConnectionString" connectionString="Data Source=sana\sqlexpress;Initial Catalog=master;Integrated Security=True" providerName="System.Data.SqlClient" /> 
    <add name="SMCConnectionString" connectionString="Data Source=sana\sqlexpress;Initial Catalog=SMC;Integrated Security=True" providerName="System.Data.SqlClient" /> 
    </connectionStrings> 
    <appSettings> 
    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None"></add> 
    </appSettings> 
    <system.web> 
    <authentication mode="None" /> 
    <compilation debug="true" targetFramework="4.5" /> 
    <httpRuntime targetFramework="4.5" /> 
    <pages> 
     <namespaces> 
     <add namespace="System.Web.Optimization" /> 
     <add namespace="Microsoft.AspNet.Identity" /> 
     </namespaces> 
     <controls> 
     <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" /> 
     <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" /> 
     </controls> 
    </pages> 
    <membership> 
     <providers> 
     <!-- 
      ASP.NET Membership is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template 
     --> 
     <clear /> 
     </providers> 
    </membership> 
    <profile> 
     <providers> 
     <!-- 
      ASP.NET Membership Profile is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template 
     --> 
     <clear /> 
     </providers> 
    </profile> 
    <roleManager> 
     <!-- 
      ASP.NET Membership Role is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template 
     --> 
     <providers> 
     <clear /> 
     </providers> 
    </roleManager> 
    <!-- 
      If you are deploying to a cloud environment that has multiple web server instances, 
      you should change session state mode from "InProc" to "Custom". In addition, 
      change the connection string named "DefaultConnection" to connect to an instance 
      of SQL Server (including SQL Azure and SQL Compact) instead of to SQL Server Express. 
     --> 
    <sessionState mode="InProc" customProvider="DefaultSessionProvider"> 
     <providers> 
     <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" /> 
     </providers> 
    </sessionState> 
    </system.web> 
    <system.webServer> 
    <modules> 
     <remove name="FormsAuthenticationModule" /> 
    </modules> 
    </system.webServer> 
    <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35" /> 
     <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" /> 
     <bindingRedirect oldVersion="0.0.0.0-2.1.0.4" newVersion="2.1.0.4" /> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" /> 
     <bindingRedirect oldVersion="0.0.0.0-1.4.9.0" newVersion="1.4.9.0" /> 
     </dependentAssembly> 
    <dependentAssembly> 
<assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" /> 
<bindingRedirect oldVersion="1.4.5.0-1.4.6.0" newVersion="1.4.6.0" /> 
</dependentAssembly> 
    </assemblyBinding> 
    </runtime> 
    <entityFramework> 
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> 
    <providers> 
     <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> 
    </providers> 
    </entityFramework> 
</configuration> 

我重建解決方案,洗乾淨。我不知道還有什麼要做。任何形式的幫助將深受讚賞。

錯誤消息:

Could not load file or assembly 'HtmlAgilityPack, Version=1.4.6.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a' or one of its dependencies. The system cannot find the file specified.

+0

缺少的程序集引用或程序集版本衝突可能會導致該問題,因爲它是由版本衝突引起的。 – 2015-02-24 17:00:08

+0

我應該如何解決這個問題? – 2015-02-24 17:00:29

+0

您是否嘗試過在解決方案中添加參考?右鍵單擊引用,添加引用,瀏覽到程序集,選擇它,單擊確定/應用。另外,我可能是錯的,但是即使它是同一個程序集的不同版本,PublicToken不應該是唯一的嗎? – CalebB 2015-02-24 17:08:40

回答

0

好吧,我做了很多搜索和感謝@Caleb和其他人通過這一切跟我在一起。我卸載並重新安裝了不同版本的CR。它引發了一些關於某些對象模型庫的COM錯誤。我刪除了參考和tada ..它現在工作正常。 ,不要忘記這樣做:

`當使用ADO.NET與Microsoft .NET框架4.0 (及以上),下面的設置必須添加到應用程序的配置文件:

<configuration> 
<startup useLegacyV2RuntimeActivationPolicy="true"> 
<supportedRuntime version="v4.0"/> 
</startup> 
</configuration>` 

希望這有助於。

1

我想誤差是與組件的版本。

您指定與後續工作:

HtmlAglilityPack: 1.4.9.0

在你的代碼有如下

<assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" /> 
<bindingRedirect oldVersion="1.4.5.0-1.4.6.0" newVersion="1.4.6.0" /> 

我相信它不應該存在,因爲你正在使用1.4.9.0新版本你已經有了這個參考。 (我錯過注意,我第一次嘗試回答)

<dependentAssembly> 
    <assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" /> 
    <bindingRedirect oldVersion="0.0.0.0-1.4.9.0" newVersion="1.4.9.0" /> 
    </dependentAssembly> 
+0

我仍然收到相同的錯誤 – 2015-02-24 17:28:52

+0

同樣的錯誤?或者你有不同的錯誤? :) – 2015-02-24 17:30:00

+0

完全一樣的錯誤。 grrrrrr – 2015-02-24 17:33:09

0
  1. 可出現由於下列DLL的不匹配這個問題列入project.Either任何的dll /包的丟失或不正確的版本,所以安裝或更新包:

AjaxControlToolkit AjaxMin HtmlAgilityPack

工具 - >庫包管理器 - >包管理器控制檯

PM>安裝包[名包帶正確版本]

實施例:PM>安裝-封裝HtmlAgilityPack -Version 1.4.6

0

嘗試此!!

1)您的解決方案 enter image description here

2只需右鍵點擊)搜索AjaxControlToolkit在線

3)點擊安裝

4)重新啓動Visual Studio

5)建立&運行

全部最好

0

Could not load file or assembly 'HtmlAgilityPack, Version=1.4.6.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a' or one of its dependencies. The system cannot find the file specified

我試着從Temp文件夾中清除所有的臨時文件。只需鍵入%Temp%並刪除該文件夾中的所有文件。
然後歡呼我的問題解決了。

注意:我嘗試了以下操作,但沒有成功:
(i)重建,重新啓動,清理解決方案+項目。 (ii)再次引用它的dll。
(iii)清除路徑C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files中的數據。 (iv)下載缺失的軟件包。

相關問題