简体   繁体   English

C#MVC无法加载文件或程序集'Microsoft.SqlServer.Types

[英]C# MVC Could not load file or assembly 'Microsoft.SqlServer.Types

I could not find my exact problem, so I have posted this question, if there is already a correct answer for this please do link it. 我找不到确切的问题,所以我已经发布了此问题,如果对此已经有正确的答案,请进行链接。

I am receiving an error: 我收到一个错误:

Could not load file or assembly 'Microsoft.SqlServer.Types 无法加载文件或程序集'Microsoft.SqlServer.Types

On my C# MVC application. 在我的C#MVC应用程序上。 This error is about a version which is not being used on a dll anymore, 10.0.0.0 instead of 12.0.0.0. 此错误是关于一个不再在dll上使用的版本10.0.0.0而不是12.0.0.0。

This error only occurs when I publish my project to IIS on a specific server and not on a local machine nor any other servers, in fact if I publish it to a different server it works perfectly. 仅当我将项目发布到特定服务器上的IIS而不是本地计算机或任何其他服务器上的IIS时,才会发生此错误,实际上,如果将项目发布到另一台服务器上,则它可以正常工作。

I have checked GAC and cannot see any problems, I have removed temporary ASP.NET files and I have crawled through every possible file using notepad++ search files*.* For the public key reference of the dll to find it and still I cannot find where the old reference is pointing from. 我已经检查了GAC,但没有看到任何问题,我已经删除了临时的ASP.NET文件,并使用notepad ++搜索文件**浏览了所有可能的文件。*对于dll的公钥引用,它仍然无法找到旧参考是从中指向的。

The dll is merged into another using ILMerge but this has not been a problem before now, just on this project and only on this server, i have even used dotnet peek to ensure the merged dll has the correct version 12.0.0.0 in it and it does. 该dll使用ILMerge合并到另一个中,但是在此之前,这不是问题,仅在该项目上并且仅在此服务器上,我什至使用dotnet peek来确保合并后的dll在其中具有正确的版本12.0.0.0。做。

It almost feels like its cached on the server somehow but I cannot figure out where, is there anything else I have not done that someone can recommended in terms of clearing some form of cached reference or something on the IIS server with the problem? 几乎感觉到它某种程度上已缓存在服务器上,但是我不知道在哪里,还有其他我没有做过的事情,有人可以就清除某种形式的缓存引用或IIS服务器上出现问题的方式提出建议吗?

It's probably looking for one of its dependencies if you'r sure the dll is in the bin folder. 如果您确定dll位于bin文件夹中,则可能正在寻找其依赖项之一。

Instead of referencing from the GAC have you tried removing the reference and adding the following NuGet package ? 您是否尝试过删除引用并添加以下NuGet软件包,而不是从GAC引用?

https://www.nuget.org/packages/Microsoft.SqlServer.Types/ https://www.nuget.org/packages/Microsoft.SqlServer.Types/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载文件或程序集 'Microsoft.SqlServer.Types,版本 = 11.0.0.0 - Could not load file or assembly 'Microsoft.SqlServer.Types, Version=11.0.0.0 程序集加载错误 - > 无法加载文件或程序集“Microsoft.SqlServer.Types,版本 = 10.0.0.0”或其依赖项之一 - Assembly Load Error - > Could not load file or assembly 'Microsoft.SqlServer.Types, Version=10.0.0.0' or one of its dependencies 即使使用复制本地,也无法加载文件或程序集“Microsoft.SqlServer.Types” - Could not load file or assembly 'Microsoft.SqlServer.Types even with Copy Local 无法加载文件或程序集“Microsoft.SqlServer.Types,Version=10.0.0.0”或其依赖项之一 - Could not load file or assembly 'Microsoft.SqlServer.Types, Version=10.0.0.0' or one of its dependencies 无法加载文件或程序集“Microsoft.SqlServer.Types, Version=12.0.0.0, Culture=neutral, PublicKeyToken=myKey”或其依赖项之一。 - Could not load file or assembly 'Microsoft.SqlServer.Types, Version=12.0.0.0, Culture=neutral, PublicKeyToken=myKey' or one of its dependencies. 无法加载文件或程序集 'Microsoft.SqlServer.Types,Version=15.0.0.0,Culture Neutral,PublicKeyToken=89845dcd8080cc91' - Could not load file or assembly 'Microsoft.SqlServer.Types,Version=15.0.0.0,Culture Neutral,PublicKeyToken=89845dcd8080cc91' 无法找到程序集“Microsoft.SqlServer.Types”版本10或更高版本 - Assembly 'Microsoft.SqlServer.Types' version 10 or higher could not be found 无法加载Microsoft.SqlServer.Types 10,但引用了版本11 - Could not load Microsoft.SqlServer.Types 10, but version 11 is referenced 使用 Microsoft.SqlServer.Types 避免程序集文件锁定 - Avoiding assembly file locks with Microsoft.SqlServer.Types Microsoft.SqlServer.Types无法加载 - Microsoft.SqlServer.Types failed to load
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM