1

I have two windows Form apps with C# and .NET Framework 4.0.

On both projects I have this App.Config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <section name="CameraSim.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
    </sectionGroup>

    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
  </startup>
  <userSettings>
    <CameraSim.Properties.Settings>
      <setting name="TRZICConn" serializeAs="String">
        <value>Data Source=UIC181;Initial Catalog=TRZIC-L;Integrated Security=False;User ID=xxxxxxx;Password=xxxxx;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False</value>
      </setting>
    </CameraSim.Properties.Settings>
  </userSettings>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.2.29.0" newVersion="2.2.29.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

In one of them the project compiles without any problem, but in the other one don't.

The error is:

You can not find schema information for the 'usersettings' element.

I have the same error with supportedRuntime, version, sku, setting, etc.

What have I forgotten?

I have also test this one, but I'm having the same problems. And on that page doesn't say anything about doing something else like adding a dll.

VansFannel
  • 45,055
  • 107
  • 359
  • 626
  • how can u have two different projects with one config file? – user786 Aug 07 '15 at 07:25
  • http://stackoverflow.com/questions/5303476/how-to-fix-error-could-not-find-schema-information-for-the-attribute-element did you had a look at this queston? – JNZ Aug 07 '15 at 07:30
  • I'm trying to use the same section with another name, but it doesn't compile. So I have decided to use the same App.config on both to check if I have missed something when I have changed section's name. But I'm getting the same error. – VansFannel Aug 07 '15 at 07:30
  • @Alex I think this is not the problem because the same App.config works fine on one project. – VansFannel Aug 07 '15 at 07:30

0 Answers0