I’m on Visual Studio 2010 and Target is 4.0. What’s wrong with this web.config?
I’m getting 500 error on local web server:
The configuration section ‘system.webserver’ cannot be read because it is missing a section declaration
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetframework="4.0">
<authentication mode="None">
</authentication>
</compilation>
</system.web>
<system.webserver>
<modules runallmanagedmodulesforallrequests="true">
</modules>
</system.webserver>
<system.servicemodel>
<servicehostingenvironment aspnetcompatibilityenabled="true">
<standardendpoints>
<webscriptendpoint>
<standardendpoint crossdomainscriptaccessenabled="true">
</standardendpoint>
</webscriptendpoint>
</standardendpoints>
</servicehostingenvironment>
</system.servicemodel>
</configuration>
It’s giving me these warnings in VS:
Warning 1 p:\jcp\WCF1\WCF1\Service1.svc: ASP.NET runtime error: Unrecognized configuration section system.webserver. (p:\jcp\WCF1\WCF1\web.config line 9) p:\jcp\WCF1\WCF1\Service1.svc 1 1 WCF1
Warning 2 The ‘targetframework’ attribute is not allowed. p:\jcp\WCF1\WCF1\Web.config 4 29 WCF1
Warning 3 The element ‘compilation’ has invalid child element ‘authentication’. List of possible elements expected: ‘assemblies, buildProviders, codeSubDirectories, expressionBuilders, folderLevelBuildProviders’. p:\jcp\WCF1\WCF1\Web.config 5 5 WCF1
I’ve set my project to use local IIS and created on virtual. My client is Windows 7 pro with iis7 and the apppool for the folder is set to 4.0. Do I need .net 3.5 installed on the client?
There are a couple of issues that I think might account for the errors you’re seeing:
system.webServer,targetFramework,system.serviceModel.)system.web.authenticationis a peer ofsystem.web.compilation, and not a child of it.