c# - 框架升级后似乎与 IIS 中的应用程序池问题相关的错误和警告
问题描述
在 Windows 7 上从 .Net Framework 4.0 更新到 4.5.2 后,我的 Soap 服务中开始出现一些意外警告和错误。
从 IIS 中删除旧的 framework 2 应用程序池后,这些错误都消失了。我还删除了所有旧的应用程序池,因此我的项目只有 1 个应用程序池。
在此之后,我无法通过添加回框架 2 应用程序池来重现错误。
我遇到并随后解决的问题在哪里
[问题1:警告]
以下程序集依赖于高于目标的 .NET Framework 版本,并且在运行时可能无法正确加载,从而导致失败
完整的错误是
Severity Code Description Project File Line Suppression State
Warning The following assembly has dependencies on a version of the .NET
Framework that is higher than the target and might not load correctly during
runtime causing a failure: SBD.Common, Version=2.0.0.1, Culture=neutral,
PublicKeyToken=a3471ea16b9add4c. The dependencies are: mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089; System,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;
System.ServiceModel, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089; System.Data, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089; System.Xml,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;
System.Core, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089. You should either ensure that the dependent
assembly is correct for the target framework, or ensure that the target
framework you are addressing is that of the dependent assembly.
**
[问题2错误]
CS1502 (mymethod) 的最佳重载方法匹配有一些无效的论点
在代码中
[SoapHeader("CoreHeader")]
public bool QueueDeleteDesigns(int itemId, int[] designIDs)
{
CheckCoreHeader();
string s = string.Join(",", designIDs);
// etc
Intellisense 还显示
The type 'IQueryable' is defined in an assembly that is not referenced. You
must add a reference to assembly 'System.Core, Version =4.0.0.0
**
[问题3警告]
警告 CS1684:对类型“System.Tuple`2”的引用声称它在“c:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll”中定义,但找不到
解决方案
我花了一整天的时间对这 3 个问题进行故障排除,但我不清楚确切的解决方法是什么,因为在解决这些问题后我无法重现它们。
我认为这与清理 IIS 中的旧应用程序池有关。
推荐阅读
- javascript - 在 if 语句中同步多个 Promise
- angularjs - AngularJS 将 1.5.6 迁移到 1.6 标记名称具有 x- 前缀
- http - 使用 JWT 的 OAuth 用于 Box API
- ios - UITableView 不显示自定义单元格的第二个实例
- powerbi - 在 Power BI 中将当前状态与前几个月进行比较
- c# - 延迟加载不起作用 C#
- elasticsearch - Elasticsearch 按好恶排序
- email - Magento 2 电子邮件显示模板提示
- java - 重做 Firebase 数据库读取 onCancelled
- swift - Swift: Using optional if statements correctly