28

After upgrading my project to Visual Studio 2010 and .Net 4.0, my app.config file generates these messages upon building the project:

  • Could not find schema information for the element 'supportedRuntime'.
  • Could not find schema information for the attribute 'version'.
  • Could not find schema information for the attribute 'sku'.

Here is my entire app.config file:

<?xml version="1.0"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
  </startup>
</configuration>

If I create a new VS2010 project and literally copy/paste the same app.config file, I receive no such messages.

Obviously these messages are not causing any runtime problems, but they are still annoying and disconcerting.

How do I fix whatever problem is making these messages appear?

I see the answer at app.config configSections custom settings can not find schema information, but I see nowhere in the properties list to enter the path to the schema.

Thanks.

Community
  • 1
  • 1
Walt D
  • 4,491
  • 6
  • 33
  • 43

4 Answers4

17

I changed the schema from DotNetConfig to DotNetConfig35 and it took care of the issue. This is available in the properties of the app.config file.

Right clicking the app.config file in solution explorer gives the properties of the file, right clicking in the edit window of the app.config file itself gives the properties of the XML document.

Gerard
  • 13,023
  • 14
  • 72
  • 125
joe
  • 179
  • 2
  • 8
    Noting because this confused me at first. At least in VS2k10 You need to look at the properties shown when the file is shown in the edit window, not the properties shown when selecting the file in Solution Explorer. – Dan Is Fiddling By Firelight Aug 11 '10 at 19:28
  • 7
    If I try that, then VS2k10 always keeps the "DotNetConfig.xsd" if I choose the "DotNetConfig35.xsd" then I and up having two schemas and I will get a lot of additional warnings. – lanoxx Jan 29 '12 at 21:00
  • 1
    @lanoxx: The solution to your problem is [here](http://stackoverflow.com/a/4400071/825024). – Otiel Jan 30 '13 at 15:21
  • 2
    I'm using VS2012 and switched from a .NET 4.5 to a .NET 3.5 project and I still get the message. The first schema is listed as `C:\Program Files (x86)\Microsoft Visual Studio 11.0\xml\Schemas\DotNetConfig35.xsd`. – PeterX Apr 23 '13 at 06:26
5

Are you sure the conversion went ok? Maybe the correct target framework wasn't configured. Open your project properties and check if the target framework is actually .NET Framework 4 or .NET Framework 4 Client Profile.

Ronald Wildenberg
  • 31,634
  • 14
  • 90
  • 133
  • It is indeed .NET Framework 4 Client Profile, as intended. There were no errors during the upgrade. – Walt D Jul 04 '10 at 16:04
-4

Remove the following section in app.config:

<startup> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/> 
</startup>
Matt
  • 41,216
  • 30
  • 109
  • 147
J Zhang
  • 1
  • 2
  • 1
    Welcome to StackOverflow. You can format your 'code' sections by indenting by 4 spaces, or using the `{}` button on the answer submission form. I've made the change already for you. Also, HTML markup (br, etc) is not necessary. – Matt Nov 16 '12 at 20:04
  • Not a good way to solve this problem. As mentioned [here](http://msdn.microsoft.com/en-us/library/w4atty68.aspx), *the element should be used by all applications built with version 1.1 or later of the .NET Framework.* – Otiel Jan 30 '13 at 14:12
-4

Try to kill the process in Task Manager next time, if it's already running.

P.S: It might be running at a remote machine.

Update: Since there is no solution I repeat my advice... Stop down voting. Maybe it's a bug but it might be related to un-terminated debug process. Just examine the Task Manager and kill xyz.vhost.exe of fx2.0, if any.

Nime Cloud
  • 6,162
  • 14
  • 43
  • 75