EPiServer.TinyMCESpellChecker / NHunspell的问题

时间:2017-05-04 15:57:59

标签: episerver nhunspell

在重新安装EPiServer.TinyMCESpellChecker软件包时,我遇到了NHunspell依赖项问题。尝试使用SpellChecker会显示一条浏览器警报消息,其中包含错误页面的HTML,并显示无法找到NHunspellx86.DLL的消息。我检查了我的bin /文件夹,确实DLL丢失了。更奇怪的是它出现在NHunspell安装的nuget packages /文件夹中。

以下是我重新安装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 个答案:

答案 0 :(得分:1)

事实证明,出现了错误消息,因为NHunspellx86和NHunspellx64 DLL位于nuget包的content文件夹中。这意味着如果文件存在于您的解决方案中,则不会被覆盖。为了解决这个错误,我不得不强制卸载NHunspell(因为我希望nuget忽略EPiServer拼写检查器依赖它):

uninstall-package nhunspell -Force

然后删除我网站项目根目录中的NHunspellx86和NHunspellx64 DLL 。事实证明,EPiServer.TinyMCESpellChecker的原始安装已将它们放在那里,而且它们存在的事实是阻止nuget通过从内容选项卡复制DLL来正确地重新安装包。删除这两个DLL后,请运行以下命令:

install-package nhunspell 

现在控制台应该显示NHunspell安装没有错误,当你再次运行EPiServer时,TinyMCESpellchecker应该没有错误!