简体   繁体   English

框架升级后,错误和警告似乎与IIS中的应用程序池问题有关

[英]Errors and warnings seemingly related to application pool issues in IIS after framework upgrade

Some unexpected warnings and errors started appearing in my Soap Service after I had updated from .Net Framework 4.0 to 4.5.2 on Windows 7. 从Windows 7上的.Net Framework 4.0更新到4.5.2之后,Soap Service中开始出现一些意外警告和错误。

The errors all disappeared after I removed an old framework 2 application pool from IIS. 从IIS中删除旧的Framework 2应用程序池后,所有错误均消失了。 I also removed all old application pools so that I only had 1 application pool for my project. 我还删除了所有旧的应用程序池,以便我的项目只有一个应用程序池。

After this I was unable to reproduce the error by adding back a framework 2 application pool. 此后,我无法通过添加回Framework 2应用程序池来重现该错误。

The issues I experienced and subsequently resolved where 我遇到的问题,后来在哪里解决了

[Issue 1: Warning] [问题1:警告]

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 以下程序集具有高于.NET Framework版本的依赖关系,该版本高于目标版本,并且在运行时可能无法正确加载,从而导致失败

The complete error was 完整的错误是

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.

** **

[Issue 2 Error] [问题2错误]

CS1502 The best overloaded method match for ( mymethod ) has some invalid arguements CS1502(mymethod)的最佳重载方法匹配有一些无效的论点

In the code 在代码中

[SoapHeader("CoreHeader")]
public bool QueueDeleteDesigns(int itemId, int[] designIDs)
{
   CheckCoreHeader();
   string s = string.Join(",", designIDs);
   // etc

Intellisense also showed 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 

** **

[Issue 3 Warning] [问题3警告]

warning CS1684: Reference to type 'System.Tuple`2' claims it is defined in 'c:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\mscorlib.dll', but it could not be found 警告CS1684:对类型'System.Tuple`2'的引用声称它已在'c:\\ Windows \\ Microsoft.NET \\ Framework \\ v2.0.50727 \\ mscorlib.dll'中定义,但找不到

  1. You probably won't need this step but just for completeness: Check your applicationhost.config file - if you manually added an entry to it, make sure it reads this for your site: 您可能不需要此步骤,只需要完整性即可:检查您的applicationhost.config文件-如果您手动向其中添加了一个条目,请确保它为您的站点读取了该条目:

    <application path="/" applicationPool="Clr4IntegratedAppPool">

  2. This would most probably fix the issue: In your web.config file, make sure your compilation tag has the framework version and a valid temporary directory path which is accessible by your IIS_IUSRS or IIS_WPG usergroups (read more about user groups here - https://docs.microsoft.com/en-us/iis/get-started/planning-for-security/understanding-built-in-user-and-group-accounts-in-iis ): 这很可能会解决此问题:在web.config文件中,确保您的编译标记具有框架版本和有效的临时目录路径,您的IIS_IUSRS或IIS_WPG用户组可以访问此路径(在此处了解有关用户组的更多信息-https:/ /docs.microsoft.com/zh-CN/iis/get-started/planning-for-security/understanding-built-in-user-and-group-accounts-in-iis ):

    <compilation debug="True" strict="False" explicit="True" targetFramework="4.0" tempDirectory="C:\\inetpub\\temp\\">

I spent a whole day troubleshooting these 3 issues , and I am unclear as to what the exact fix was, because after fixing the issues I was unable to reproduce them. 我花了一整天的时间对这3个问题进行了故障排除,但不清楚确切的解决方案是什么,因为修复这些问题后,我无法重现它们。

I think it was to do with cleaning up old application pools in IIS. 我认为这与清理IIS中的旧应用程序池有关。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM