最近我开始使用SSMS 2017(v17.5)。在我的MVC应用程序中,我遇到了以下错误。
无法加载文件或程序集'Microsoft.SqlServer.Types, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'或其依赖项之一。
我应用程序中唯一改变的是'Microsoft.SqlServer.Types'的版本,现在是'14.0.0.0'。之前是'12.0.0.0'。
根据我的研究,我尝试了以下不同的选项(包括其他stackoverflow文章+谷歌),但是我仍然得到相同的错误。
1. 在'app.config'中添加''
在
使用NuGet安装Microsoft.SqlServer.Types。
在整个项目中搜索了
我已经安装了
无法加载文件或程序集'Microsoft.SqlServer.Types, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'或其依赖项之一。
我应用程序中唯一改变的是'Microsoft.SqlServer.Types'的版本,现在是'14.0.0.0'。之前是'12.0.0.0'。
根据我的研究,我尝试了以下不同的选项(包括其他stackoverflow文章+谷歌),但是我仍然得到相同的错误。
1. 在'app.config'中添加''
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="10.0.0.0-11.0.0.0" newVersion="14.0.0.0" />
</dependentAssembly>
在
Global.asax.cs
文件的Application_Start
方法中添加以下行。SqlProviderServices.SqlServerTypesAssemblyName = "Microsoft.SqlServer.Types, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91";
使用NuGet安装Microsoft.SqlServer.Types。
PM> Install-Package Microsoft.SqlServer.Types
10.0.0.0
的引用,但没有找到任何引用。Microsoft System CLR Types for SQL Server
,适用于2012、2014、2016
和2017
。我在这里漏掉了什么?
hierarchyid
列? - Aaron Bertrandhierarchyid
。 - GThreeCREATE TABLE
吗? - Aaron BertrandMicrosoft.SqlServer.Types
,然后您将看到所有引用它的项目。检查每个对Microsoft.SqlServer.Types
的引用的属性,看看哪一个是针对 10.0.0.0 的。 - Always Learning