我有两个带有C#和.NET Framework 4.0的Windows窗体应用程序。
在这两个项目中,我都有这个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>
在其中一个项目中,项目编译没有任何问题,但在另一个项目中没有。
错误是:
您找不到'usersettings'元素的架构信息。
我对supportedRuntime,version,sku,setting等有同样的错误。
我忘记了什么?
我也测试了这个one,但我遇到了同样的问题。并且在该页面上没有说任何关于做其他事情的事情,比如添加一个dll。