2017-05-04 56 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应不会出现错误的工作!