1

I have an app (wcf service) compiled to 4.7.2. All of the projects in the solution target that framework version.

On the server (Windows Server 2016), Framework 4.7.2 is installed (and is reported as ASP.NET Version:4.7.3282.0 in the error page)

The error that's being thrown when I browse to the WCF service:

"The 'targetFramework' attribute in the element of the Web.config file is used only to target version 4.0 and later of the .NET Framework (for example, ''). The 'targetFramework' attribute currently references a version that is later than the installed version of the .NET Framework. Specify a valid target version of the .NET Framework, or install the required version of the .NET Framework."

Here's the indicated error lines from the web config (error is on line 25):

Line 23: </appSettings>
Line 24: <system.web>
Line 25: <compilation targetFramework="4.7.2" />
Line 26: <httpRuntime targetFramework="4.7.2" />
Line 27: <customErrors mode="Off" />

If I open a command prompt and go to the c:\windows\microsoft.net\framework64\v4.0.30319 directory and run "msbuild -version", it responds

4.7.2053.0

I tried changing around some app pool settings to no avail. Anyone have some ideas?

Edit: I downgraded all the projects within my solution to version 4.7, and that seems to have resolved the issue. I'm not sure why, since the server gives every indication that 4.7.2 is installed

Tom
  • 31

1 Answers1

2

Microsoft, in their infinite versioning wisdom, has deemed that the MS Build version I was seeing (4.7.2053.0) is actually Framework version 4.7. What's more, the version indicated on the error page (4.7.3xxx) is actually the ASP.NET version, which is different than the framework version.

So, despite all indications that I was on version 4.7.2 (to include our server admin saying we were), I was actually on 4.7.

Once we installed version 4.7.2, things worked.

Tom
  • 31