I have created a WPF application. I am using Visual Studio setup project to create application setup.
In my application, I have a local database which is located in project folder (Application folder). When I install the application to any other drive than C: drive (operating system drive), then it is working fine. But when I install the application to the C:
drive, then my application is not able to access the database file. Also, when I attach the database to SQL Server Management Studio, it is attaching as readonly:
Also, I viewed the Eventviewer and I find this error:
I tried adding the .mdf
file to the Programdata
folder but still the issue is not resolved. I am aware that it is a permission related issue. But is there any way to resolve this issue using Visual Studio setup project?