0

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.

The errors all disappeared after I removed an old framework 2 application pool from IIS. 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.

The issues I experienced and subsequently resolved where

[Issue 1: 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

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]

CS1502 The best overloaded method match for ( mymethod ) has some invalid arguements

In the code

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

Intellisense also showed

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]

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

Kirsten
  • 15,730
  • 41
  • 179
  • 318

2 Answers2

0
  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:

    <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://learn.microsoft.com/en-us/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\">

Shree Harsha
  • 377
  • 3
  • 9
0

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.

I think it was to do with cleaning up old application pools in IIS.

Kirsten
  • 15,730
  • 41
  • 179
  • 318