2017-05-04 58 views
0

問題在重新安裝EPiServer.TinyMCESpellChecker包期間,我遇到了NHunspell依賴性問題。試用SpellChecker會顯示瀏覽器警報消息,其中包含錯誤頁面的HTML,並顯示無法找到NHunspellx86.DLL的消息。我檢查了我的文件夾/文件夾,確實缺少DLL。奇怪的是,它出現在NHunspell安裝的nuget包/文件夾中。EPiServer.TinyMCESpellChecker/NHunspell

以下是錯誤消息,當我重新安裝NHunspell特別是表明:

PM> update-package -reinstall nhunspell 
Attempting to gather dependency information for multiple packages with respect to project 'Guthrie.Web', targeting '.NETFramework,Version=v4.6.2' 
Gathering dependency information took 7.41 sec 
Attempting to resolve dependencies for multiple packages. 
Resolving dependency information took 0 ms 
Resolving actions install multiple packages 
Retrieving package 'NHunspell 1.2.5554.16953' from 'nuget.org'. 
Removed package 'NHunspell 1.2.5554.16953' from 'packages.config' 
Successfully uninstalled 'NHunspell 1.2.5554.16953' from Guthrie.Web 
Package 'NHunspell.1.2.5554.16953' already exists in folder 'C:\TFS2013\ClientGITCollection\Guthrie\GuthrieEpi\packages' 
'Hunspellx86.dll' already exists. Skipping... 
'Hunspellx64.dll' already exists. Skipping... 
Added package 'NHunspell.1.2.5554.16953' to 'packages.config' 
Executing script file 'C:\TFS2013\ClientGITCollection\Guthrie\GuthrieEpi\packages\NHunspell.1.2.5554.16953\tools\install.ps1' 
Value does not fall within the expected range. 
At C:\TFS2013\ClientGITCollection\Guthrie\GuthrieEpi\packages\NHunspell.1.2.5554.16953\tools\install.ps1:4 char:1 
+ $hunspellx86Dll = $project.ProjectItems.Item("Hunspellx86.dll") 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : OperationStopped: (:) [], ArgumentException 
    + FullyQualifiedErrorId : System.ArgumentException 

You cannot call a method on a null-valued expression. 
At C:\TFS2013\ClientGITCollection\Guthrie\GuthrieEpi\packages\NHunspell.1.2.5554.16953\tools\install.ps1:5 char:1 
+ $hunspellx86Dll.Properties.Item("BuildAction").Value = 0 # BuildActio ... 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : InvalidOperation: (:) [], RuntimeException 
    + FullyQualifiedErrorId : InvokeMethodOnNull 

You cannot call a method on a null-valued expression. 
At C:\TFS2013\ClientGITCollection\Guthrie\GuthrieEpi\packages\NHunspell.1.2.5554.16953\tools\install.ps1:6 char:1 
+ $hunspellx86Dll.Properties.Item("CopyToOutputDirectory").Value = 2 # ... 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : InvalidOperation: (:) [], RuntimeException 
    + FullyQualifiedErrorId : InvokeMethodOnNull 

Value does not fall within the expected range. 
At C:\TFS2013\ClientGITCollection\Guthrie\GuthrieEpi\packages\NHunspell.1.2.5554.16953\tools\install.ps1:10 char:1 
+ $hunspellx64Dll = $project.ProjectItems.Item("Hunspellx64.dll") 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : OperationStopped: (:) [], ArgumentException 
    + FullyQualifiedErrorId : System.ArgumentException 

You cannot call a method on a null-valued expression. 
At C:\TFS2013\ClientGITCollection\Guthrie\GuthrieEpi\packages\NHunspell.1.2.5554.16953\tools\install.ps1:11 char:1 
+ $hunspellx64Dll.Properties.Item("BuildAction").Value = 0 # BuildActio ... 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : InvalidOperation: (:) [], RuntimeException 
    + FullyQualifiedErrorId : InvokeMethodOnNull 

You cannot call a method on a null-valued expression. 
At C:\TFS2013\ClientGITCollection\Guthrie\GuthrieEpi\packages\NHunspell.1.2.5554.16953\tools\install.ps1:12 char:1 
+ $hunspellx64Dll.Properties.Item("CopyToOutputDirectory").Value = 2 # ... 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : InvalidOperation: (:) [], RuntimeException 
    + FullyQualifiedErrorId : InvokeMethodOnNull 

Successfully installed 'NHunspell 1.2.5554.16953' to Guthrie.Web 

回答

1

事實證明,該錯誤信息是出現因爲NHunspellx86和NHunspellx64 DLL是在NuGet包的內容文件夾。這意味着如果該文件存在於您的解決方案中,則不會被覆蓋。爲了解決這個錯誤,我不得不強迫卸載NHunspell(力,因爲我想的NuGet忽略了EPiServer拼寫檢查依賴於它):

uninstall-package nhunspell -Force 

,然後刪除NHunspellx86和NHunspellx64 DLL在根我的網站項目。事實證明,EPiServer.TinyMCESpellChecker的原始安裝已經將它們放在那裏,並且它們存在的事實是通過從內容選項卡複製DLL來防止nuget正確重新安裝程序包。你刪除這兩個DLL年代後,運行以下命令:

install-package nhunspell 

現在控制檯應該顯示NHunspell安裝沒有錯誤,當你再次運行EPiServer,該TinyMCESpellchecker應不會出現錯誤的工作!