i generated my dataaccess dll using subsonic 3.0. i have a new proj referenced to this dll and am tryign to insert data to my mysql database.
i get the following configuration error. however when i look at my App.config, i have a connectionstring that defines my database connection.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="dbTorontoTrader"
connectionString="server=localhost;database=dbtorontotrader;user id=root; password=password"
providerName="MySql.Data.MySqlClient"/>
<!-- For MySQL -->
</connectionStrings>
<system.data>
<DbProviderFactories>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=5.1.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
</configuration>
System.Configuration.ConfigurationErrorsException was unhandled
Message="Failed to find or load the registered .Net Framework Data Provider."
Source="System.Data"
BareMessage="Failed to find or load the registered .Net Framework Data Provider."
Line=0
StackTrace:
at System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow)
at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
at SubSonic.DataProviders.DbDataProvider..ctor(String connectionString, String providerName)
at SubSonic.DataProviders.ProviderFactory.LoadProvider(String connectionString, String providerName)
at SubSonic.DataProviders.ProviderFactory.GetProvider(String connectionStringName)
at TorontoTrader.Data.Ver2.dbTorontoTraderDB..ctor() in E:\TradingTools\CODE\TorontoTraderDataVer2\TorontoTraderDataVer2\Context.cs:line 37
at TorontoTrader.Data.Ver2.scans_log.GetRepo(String connectionString, String providerName) in E:\TradingTools\CODE\TorontoTraderDataVer2\TorontoTraderDataVer2\ActiveRecord.cs:line 10338
at TorontoTrader.Data.Ver2.scans_log.GetRepo() in E:\TradingTools\CODE\TorontoTraderDataVer2\TorontoTraderDataVer2\ActiveRecord.cs:line 10354
at TorontoTrader.Data.Ver2.scans_log.SingleOrDefault(Expression`1 expression) in E:\TradingTools\CODE\TorontoTraderDataVer2\TorontoTraderDataVer2\ActiveRecord.cs:line 10359
at ConsoleApplication1.Program.Main(String[] args) in E:\TradingTools\CODE\TorontoTraderDataVer2\ConsoleApplication1\Program.cs:line 13
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
your app config should look like this:
<configuration>
<connectionStrings>
<add name="dbTorontoTrader" connectionString="server=localhost;database=dbtorontotrader;user id=root; password=password" providerName="MySql.Data.MySqlClient"/>
</connectionStrings>
</configuration>
Make note of the element that is missing
You need to add connectionstrings element.
Your app.config should look like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="dbTorontoTrader"
connectionString="server=localhost;database=dbtorontotrader;user id=root; password=password"
providerName="MySql.Data.MySqlClient"/>
</connectionStrings>
</configuration>
Related
App.config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<entityFramework>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<add name="SQLiteConnection" providerName="System.Data.SQLite.EF6" connectionString="Data Source=C:\Users\wzz\source\repos\PutixinEditor\PutixinEditor\db.sqlite" />
</DbProviderFactories>
</system.data>
</configuration>
my dbContext:
class PutixinDbContext : DbContext
{
public PutixinDbContext() : base("SQLiteConnection")
{
Database.SetInitializer<PutixinDbContext>(null);
}
public DbSet<Category> Category { get; set; }
}
But when I context.SaveChanges(), error throw:
SqlException: Cannot open database "SQLiteConnection" requested by the login. The login failed.
Login failed for user 'DESKTOP-BR8U8NG\wzz'.
I am using Visual Studio 2019
Error: "System.Data.SqlClient.SqlException: Cannot open database "MyDatabase" requested by the login. The login failed.
Login failed for user 'MyComputer\myUser'."
The error is very misleading because in your case, it will happen even if the the user has full permissions to write to the file and directory in question, in your case directory C:\Users\wzz\source\repos\PutixinEditor\PutixinEditor\ and file C:\Users\wzz\source\repos\PutixinEditor\PutixinEditor\db.sqlite.
The name of the string parameter passed to the DBContext constructor is "nameOrConnectionString". You are not passing a connection string, but instead your provider name. You have no such connection string.
As per Microsofts documentation, since no such connection string is found, the name is passed to the DefaultConnectionFactory, which wants to connect to a MsSQL or SqlExpress database. This is probably where the "Login failed" message comes from.
However,there is no ConnectionFactory class in System.Data.Sqlite.EF6 (v4.0.30319) which you could use instead.
Here is what will work: Create and name a separate connection string:
<connectionStrings>
<add name="SQLiteConnection" connectionString="data source=C:\Users\wzz\source\repos\PutixinEditor\PutixinEditor\db.sqlite;foreign keys=true" providerName="System.Data.SQLite" />
</connectionStrings>
You also have to configure the corresponding ProviderFactory, or else you'll get an error about not finding the requested provider
(With the friendly message "The ADO.NET provider with invariant name 'System.Data.SQLite' is either not registered in the machine or application config file, or could not be loaded.").
The provider factory you need is System.Data.SQLite.SQLiteFactory (from the System.Data.SQLite assembly).
<DbProviderFactories>
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
</DbProviderFactories>
Now your DbContext should work.
I got the same error when I misspelled the name of the connection string in the constructor of the DbContext. It was very confusing because there was absolutely nothing wrong with the permissions of the sqlite file.
I have a project using SqlServerCe.3.5 with EntityFramework 6. I want to change the database to PostgreSQL so I changed the configuration
From:
<entityFramework>
<providers>
<provider invariantName="System.Data.SqlServerCe.3.5" type="System.Data.Entity.SqlServerCompact.Legacy.SqlCeProviderServices, EntityFramework.SqlServerCompact.Legacy" />
</providers>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
<parameters>
<parameter value="System.Data.SqlServerCe.3.5" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
<connectionStrings>
<add name="Model1Container" connectionString="Data Source=<.. DB.sdf ...>" providerName="System.Data.SqlServerCe.3.5" />
</connectionStrings>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.3.5" />
<add name="Microsoft SQL Server Compact Data Provider 3.5" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</DbProviderFactories>
</system.data>
To:
<entityFramework>
<providers>
<provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, Npgsql.EntityFramework" />
</providers>
</entityFramework>
<connectionStrings>
<add name="Model1Container" connectionString="Server=localhost;<...>" providerName="Npgsql" />
</connectionStrings>
<system.data>
<DbProviderFactories>
<remove invariant="Npgsql" />
<add name="Npgsql Data Provider" invariant="Npgsql" description="Data Provider for PostgreSQL" type="Npgsql.NpgsqlFactory, Npgsql" />
</DbProviderFactories>
</system.data>
When I run my software with the new config file I got the following error:
DbMigrator migrator = new DbMigrator(new Migrations.Configuration());
var latestMigration = migrator.GetLocalMigrations().Last();
var charPos = latestMigration.IndexOf("_");
var migrationName = latestMigration.Substring(charPos + 1, latestMigration.Length - charPos - 1);
migrator.Update(migrationName); // <<< it crashes here!!
Exception:
The ADO.NET provider with invariant name 'System.Data.SqlServerCe.3.5' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details.
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Loader.ThrowOnNonWarningErrors()
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Loader.LoadItems(IEnumerable'1 xmlReaders, IEnumerable'1 sourceFilePaths)
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Loader..ctor(IEnumerable'1 xmlReaders, IEnumerable'1 sourceFilePaths, Boolean throwOnError, IDbDependencyResolver resolver)
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Init(IEnumerable'1 xmlReaders, IEnumerable'1 filePaths, Boolean throwOnError, IDbDependencyResolver resolver, DbProviderManifest& providerManifest, DbProviderFactory& providerFactory, String& providerInvariantName, String& providerManifestToken, Memoizer'2& cachedCTypeFunction)
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection..ctor(IEnumerable'1 xmlReaders)
at System.Data.Entity.Utilities.XDocumentExtensions.GetStorageMappingItemCollection(XDocument model, DbProviderInfo& providerInfo)
at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.Diff(XDocument sourceModel, XDocument targetModel, Lazy`1 modificationCommandTreeGenerator, MigrationSqlGenerator migrationSqlGenerator, String sourceModelVersion, String targetModelVersion)
at System.Data.Entity.Migrations.DbMigrator.IsModelOutOfDate(XDocument model, DbMigration lastMigration)
at System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable'1 pendingMigrations, String targetMigrationId, String lastMigrationId)
at System.Data.Entity.Migrations.Infrastructure.MigratorBase.Upgrade(IEnumerable'1 pendingMigrations, String targetMigrationId, String lastMigrationId)
at System.Data.Entity.Migrations.DbMigrator.UpdateInternal(String targetMigration)
at System.Data.Entity.Migrations.DbMigrator.<>c__DisplayClassc.b__b()
at System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase)
at System.Data.Entity.Migrations.Infrastructure.MigratorBase.EnsureDatabaseExists(Action mustSucceedToKeepDatabase)
at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)
at DAL.Session.Init() in <...>
I got this error message but my PostgreSQL database is created with all the tables defined in my CodeFirst EntityFramework.
In the machine.config there is no SqlServerCe nor Npgsql defined.
Is it possible that somewhere hidden there is a settings I don't see? I made a text search on all config and project files and I don't see any possible reason.
SOLUTION! (For those who by any chance get into the same problem )
I ended up removing the migration completely and I rebuilt from scratch. I had used Enable-Migrations which was somehow linked to the current configuration. When I enable migration now, it was running without any problem.
I am trying to connect my C# application to an oracle database using Oracle.ManagedDataAccess. However, when I try to create the database it gives me the error below. Any ideas as to what I'm setting up incorrectly? I know that the provider name is set correctly, because I'm able to connect to the database exactly the same way with another C# application.
"The requested database ConnectionString.SomeName does not have a valid ADO.NET provider name set in the connection string"
On machine.config:
<add name="ConnectionString.SomeName" providerName="Oracle.ManagedDataAccess.Client" connectionString="Data Source=databaseSource;User Id=some_id;Password=some_password" />
On web.config:
<appSettings>
<add key="ConnectionString1" value="ConnectionString.SomeName"/>
</appSettings>
My code:
DatabaseProviderFactory factory = new DatabaseProviderFactory();
Database = factory.Create(ConfigurationManager.AppSettings["ConnectionString1"]);
In the Machine.config, check to ensure that you have two sections setup. One in " and another in . Examples below:
<appSettings>
<add key="ConnectionString.SomeName" value="Data Source=databaseSource;User Id=some_id;Password=some_password"/>
</appSettings>
<connectionStrings>
<add name="ConnectionString.SomeName" connectionString="Data Source=databaseSource;User Id=some_id;Password=some_password" providerName="Oracle.DataAccess.Client"/>
</connectionStrings>
The 'key' in your appSettings entry should match the 'name' in your connectionStrings entry.
For example, in your case, you should have this entry in appSettings:
<add key="ConnectionString.SomeName" value="Data Source=dataSource;User ID=some_id;Password=some_password" />
The solution that worked for me is to add the following to the App.config / Web.config (within the configuration tag):
<system.data>
<DbProviderFactories>
<remove invariant="Oracle.ManagedDataAccess.Client" />
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data>
Hi I have a few projects in Solution.
In project A, I have app.config with connection string called Ver3ConnectionString. But when I do debug, the connection string is not found in code:). While debugging connection strings contains one which is not defined in this app.config, nether in my app :). Im using VS2013 Express :).
Moreover, applicationSettings are ones which are defined in main project:), but not one which is being dubugged.
Magic:).
ADDED:
THe solution was created by my coworker from existing project, so Im looking for error in solution/project files.
MobileWalletContext class is connected with EntityFramework 6.X. Maybe this is the problem?
Added 2:
This unknown connection string has name ="LocalSqlServer". Maybe this will be helpful?
App.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="Ver3ConnectionString"
connectionString="Data Source=PAZI-PRO2\SQLEXPRESS;Initial Catalog=MobileWalletVer3;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
C# code where connsterionString is called:
public MobileWalletContext() : base(string.Format("name={0}",ConfigurationManager.ConnectionStrings["Ver3ConnectionString"].ConnectionString))
{
Database.SetInitializer(new DropCreateDatabaseIfModelChanges<MobileWalletContext>());
}
Name of the connection string is not likely to change. Therefore I would simplify context constructor to:
public MobileWalletContext() : base("Ver3ConnectionString")
{
Database.SetInitializer(new DropCreateDatabaseIfModelChanges<MobileWalletContext>());
}
That way I could define different connection string in each project using Ver3ConnectionString name.
EDIT
DbContext base constructor accepts both connection string name or full connection string.
In your case instead of referencing existing connection string you are just creating a new connection string with provided name and default settings. Thats why you are seeing LocalSqlServer.
If you pass name of existing connection string in config, it will be picked up and used.
EDIT
Make sure your connection strings are in app.config or web.config file in your main project directory.
I'd like to add this to what #Kaspars-Ozols wrote:
LocalSqlServer is your SQL Express installation and its configuration usually resides in a machine.config file like C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config. You may have more than 1 machine.config [2 runtimes (2.0 and 4.0)] x [2 Bitness (x86 and x64)] makes 4 machine.config files!
<connectionStrings>
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
</connectionStrings>
It's a good habit to use <clear /> at the very beginning of <appSettings> or <connectionStrings> sections.
<connectionStrings>
<clear/>
<add name="MembershipConnection" connectionString="Server=.;UId=some_user;PWd=P#$$w0rd;Database=DBName" providerName="System.Data.SqlClient" />
<add name="ElmahConnection" connectionString="Server=.;UId=some_elmah_user;PWd=P#$$w0rd;Database=DBName" providerName="System.Data.SqlClient" />
</connectionStrings>
I have the following configuration file in a application console:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/>
<section name="ConsoleApplication1.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup><applicationSettings>
<ConsoleApplication1.Properties.Settings>
<setting name="AppName" serializeAs="String">
<value>Simple Application</value>
</setting>
</ConsoleApplication1.Properties.Settings>
</applicationSettings>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory name="NHibernate.Test">
<property name="connection.driver_class">
NHibernate.Driver.SqlClientDriver
</property>
<property name="connection.connection_string">
Data Source=.\SQLEXPRESS;Initial Catalog=TravelAssistant;Integrated Security=True
</property>
<property name="adonet.batch_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="use_outer_join">true</property>
<property name="command_timeout">60</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<property name="proxyfactory.factory_class">
NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu
</property>
</session-factory>
</hibernate-configuration>
</configuration>
The nhibernate section I haved copied from an dummy application (console application) where it worked just fine. When I run my app (a slightly bigger one with more class library projects involved and referenced) I get the following exception:
System.Configuration.ConfigurationErrorsException was unhandled
Message=Configuration system failed to initialize
Source=System.Configuration
BareMessage=Configuration system failed to initialize
Line=0
StackTrace:
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(String sectionName)
at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.RefreshConfig(String sectionName)
at System.Configuration.ConfigurationManager.RefreshSection(String sectionName)
at System.Configuration.ClientSettingsStore.ReadSettings(String sectionName, Boolean isUserScoped)
at System.Configuration.LocalFileSettingsProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties)
at System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider)
at System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName)
at System.Configuration.SettingsBase.get_Item(String propertyName)
at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String propertyName)
at System.Configuration.ApplicationSettingsBase.get_Item(String propertyName)
at TravelAssistant.OnlineAPIs.Properties.Settings.get_HotelsAllStarsURL() in C:\Users\Tamas_Ionut\Documents\Visual Studio 2010\Projects\TravelAssistant\TravelAssistant.OnlineAPIs\Properties\Settings.Designer.cs:line 49
at TravelAssistant.OnlineAPIs.Implementations.CoreModels.Lodging.HotelLodgingProvider.ConstructURL(Location location, Decimal lowPrice, Decimal highPrice, List`1 numberOfStars, Int32 lowCustomerRating, Int32 highCustomerRating, DateTime checkIn, DateTime checkOut, Int32 numberOfAdults) in C:\Users\Tamas_Ionut\Documents\Visual Studio 2010\Projects\TravelAssistant\TravelAssistant.OnlineAPIs\Implementations\CoreModels\Lodging\HotelLodgingProvider.cs:line 77
at TravelAssistant.OnlineAPIs.Implementations.CoreModels.Lodging.HotelLodgingProvider.RetrieveHotels(Location location, Decimal lowPrice, Decimal highPrice, List`1 numberOfStars, Int32 lowCustomerRating, Int32 highCustomerRating, DateTime checkIn, DateTime checkOut, Int32 numberOfAdults) in C:\Users\Tamas_Ionut\Documents\Visual Studio 2010\Projects\TravelAssistant\TravelAssistant.OnlineAPIs\Implementations\CoreModels\Lodging\HotelLodgingProvider.cs:line 148
at ConsoleApplication1.Program.Main(String[] args) in C:\Users\Tamas_Ionut\Documents\Visual Studio 2010\Projects\TravelAssistant\ConsoleApplication1\Program.cs:line 23
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Configuration.ConfigurationErrorsException
Message=Unrecognized configuration section hibernate-configuration. (C:\Users\Tamas_Ionut\Documents\Visual Studio 2010\Projects\TravelAssistant\ConsoleApplication1\bin\Debug\ConsoleApplication1.vshost.exe.Config line 18)
Source=System.Configuration
BareMessage=Unrecognized configuration section hibernate-configuration.
Filename=C:\Users\Tamas_Ionut\Documents\Visual Studio 2010\Projects\TravelAssistant\ConsoleApplication1\bin\Debug\ConsoleApplication1.vshost.exe.Config
Line=18
StackTrace:
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
InnerException:
The dummy app where I haved tested the same Db connection with hibernate worked just fine.
If I remove the nhibernate section the rest of the app runs just fine.
Could someone give me a hint where is the issue? (the nhibernate versions are corect)
Thanks,
Tamas
Did you add all the required NHibernate references to the project? This looks to me like the app can't load the NH configuration section handler and thus doesn't recognize the entire <hibernate-configuration> block.