I learn to work with the built-in profile provider of .Net, and have the following
problem:
I read that the machine.config-settings can be overridden by the web.config-settings
of a .Net-Application. The following settings in the machine.config-file are relevant
for me:
<connectionStrings>
<add name="LocalSqlServer" connectionString="Data Source=(local);Initial Catalog=aspnetdb;
Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<profile><providers><add name="AspNetSqlProfileProvider"connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/></providers></profile>
These settings work to set up local profiles.
However, when I copy the settings into the web.config of my application and change the
machine.config settings, so that they don′t work any more, I get a configuration
error.
For example, I change the name of the provider in the machine.config to "Local".
This should be no problem, because the settings are overridden. However, when running
the application I get the error:
"The entry "AspNetSQLProvider has already been added" (my translation)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…