I am working on a localhost environment and going through Chapter 8 of DiscoverXModPro.
The tools are VMware, Windows 10 Pro, DNN v950, SQL Express 2019, SSMS 2018 and XModPro v4.9
- All the environment is running inside a VM with Windows 10 Pro.
- My local address for DNN is http:localhost\DNN950
- The installation was done at C:\_Home\DNN950
- The database resides at C:\_Home\DNN950\App_Data\Database.mdf
- The connection string for DNN within settings.config is:
<add name="SiteSqlServer" connectionString="Data Source=.\SQLExpress;AttachDbFilename=|DataDirectory|Database.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
My issue is, when I followed chapter 8 of DiscoverXModPro the task at hand was to connect SSMS to DNN's Database.mdf. Since it was not visible, I tried to attach DNN's Database:
I had this error:
CREATE FILE encountered operating system error 32(The process has no access to the file because it is being used by another process.) while attempting to open or create the physical file 'C:\_Home\dnn950\App_Data\Database.mdf'. (Microsoft SQL Server, Error: 5123)
I closed every DNN window and restarted the VM to be able to attach the Database. The connection mode was Windows Authentication, while running SSMS as Admin (as "admin", since otherwise it wouldn't connect).
From then on, DNN would not start again, just telling me "DNN Error - Connection To The Database Failed".
What I did try after that:
- Detach the Database from SSMS, while running it as Admin.
- Re-attach the Database from SSMS, and detach it again, running as Admin or Non-Admin...
- Restart the VM.
- Clear all caches from browsers (I use Vivaldi and Edge).
Nothing else was changed. I wonder:
1. Why DNN would not reconnect to its Database?
2. Main Question Here: How to work simultaneously with DNN and SSMS side by side.