安裝InfoPath 2013后 SharePoint 2010 出現 “找不到 Microsoft.Office.InfoPath, Version=14.0.0....” 的錯誤的解決方案


1. 症狀

您的SharePoint 2010的服務器是不是最近一直出現這個錯誤呢?

Could not load file or assembly 'Microsoft.Office.InfoPath, Version=14.0.0.0' (...)

 特別是當我們部署新的InfoPath解決方案時,我們突然之間發現,無法把模板上傳到服務器當中去了,但是我們發現在GAC中,這個Microsoft.Office.InfoPath.dll 是存在的

問題出在哪里?

infopath1

 

 

2.分析過程

在日志中有這么一句話:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.InfoPath, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.

根據前文分析,文件是一定存在的,但為什么呢,我們繼續打開編譯日志文件


報告如下:

*** Assembly Binder Log Entry (4/12/2012 @ 12:51:23) ***
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll
Running under executable c:\windows\system32\inetsrv\w3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = WINDEVSP2010\SPInstaller
LOG: DisplayName = Microsoft.Office.InfoPath, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
(Fully-specified)
LOG: Appbase = file:///C:/inetpub/wwwroot/wss/VirtualDirectories/80741441fc-0d39-48f0-954e-96614c358095/
LOG: Initial PrivatePath = C:\inetpub\wwwroot\wss\VirtualDirectories\80741441fc-0d39-48f0-954e-96614c358095\bin
LOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\ef3f51d0
LOG: Cache Base = C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\ef3f51d0
LOG: AppName = a6d35fbc
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\inetpub\wwwroot\wss\VirtualDirectories\80741441fc-0d39-48f0-954e-96614c358095\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Publisher policy file is found at C:\Windows\assembly\GAC_MSIL\Policy.14.0.Microsoft.Office.InfoPath\15.0.0.0__71e9bce111e9429c\Policy.14.0.Microsoft.Office.InfoPath.config.
LOG: Publisher policy file redirect is found: 14.0.0.0 redirected to 15.0.0.0.
LOG: ProcessorArchitecture is locked to MSIL.
LOG: Post-policy reference: Microsoft.Office.InfoPath, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/root/ef3f51d0/a6d35fbc/Microsoft.Office.InfoPath.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/root/ef3f51d0/a6d35fbc/Microsoft.Office.InfoPath/Microsoft.Office.InfoPath.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/wss/VirtualDirectories/80741441fc-0d39-48f0-954e-96614c358095/bin/Microsoft.Office.InfoPath.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\inetpub\wwwroot\wss\VirtualDirectories\80741441fc-0d39-48f0-954e-96614c358095\bin\Microsoft.Office.InfoPath.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: Microsoft.Office.InfoPath, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Setup failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

現在我們找到原因了!好像是GAC的某個設置把14.00重定向到15.000,但是這個DLL又不支持SharePoint 2010,呵呵。

我們在運行當中打開如下的目錄:

C:\Windows\assembly\GAC_MSIL

我發現如下的文件夾:Policy.14.0.Microsoft.Office.InfoPath 有一個子文件夾 “15.0.0.0__71e9bce111e9429c”.

我繼續查看web.config文件中的設置,設置中有這么一段:

<?xml version="1.0" encoding="UTF-16"?>
<configuration>
	<runtime>
		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
			<dependentAssembly>
				<assemblyIdentity publicKeyToken="71e9bce111e9429c" name="Microsoft.Office.InfoPath" culture="neutral"></assemblyIdentity>
				<bindingRedirect oldVersion="14.0.0.0" newVersion="15.0.0.0"></bindingRedirect>
			</dependentAssembly>
		</assemblyBinding>
	</runtime>
</configuration>

哈哈找到問題了!

 

3.解決方案

 

1. 打開“開始-運行” ,輸入: C:\Windows\Assembly\GAC_MSIL

2.刪除掉如下的文件夾:

Policy.14.0.Microsoft.Office.InfoPath
Policy.14.0.Microsoft.Office.InfoPath.Client.Internal.Host
Policy.14.0.Microsoft.Office.InfoPath.FormControl

3.  運行“ IISRESET /noforce” 重啟IIS

哈哈哈,終於可以繼續我的InfoPath的部署和開發拉!

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM