[DevExpress Support Team: CLONED FROM T419520: How to troubleshoot the "Reentrancy or cross thread operation detected" error]
Hello DevExpress,
switch from
string connectionString = "Server=tcp:…,1433;Initial Catalog…";
dataLayer = XpoDefault.GetDataLayer(defaultConnectionString, AutoCreateOption.DatabaseAndSchema);
to TheadSafeDataLayer described here: https://docs.devexpress.com/XPO/DevExpress.Xpo.ThreadSafeDataLayer
Can I still set/change the connection string of an UnitOfWork?
Before:
string connectionString = "Server=tcp:…,1433;Initial Catalog…";
myUnitOfWorkConnectionString = connectionString;
After:
string connectionString = ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString;
connectionString = XpoDefault.GetConnectionPoolString(connectionString);
myUnitOfWorkConnectionString = connectionString;
Regards. Walter.