技术咨询:完成Identity Server数据库创建后无法定位其存储位置
Hey there! Since you’ve successfully wrapped up the database object creation steps for Identity Server but aren’t sure where the database is stored, here are the most practical ways to track it down:
Check your project’s connection string
Open your project’sappsettings.json(for .NET Core projects) orweb.config(for .NET Framework projects) and locate theConnectionStringssection. This entry will explicitly tell you which database instance and name was used. For example, if you’re using LocalDB (the default for many Identity Server tutorials), the connection string might look likeServer=(LocalDB)\\MSSQLLocalDB;Database=YourIdentityDbName;Trusted_Connection=True;. LocalDB files are typically saved inC:\Users\[Your Windows Username]\with.mdf(data file) and.ldf(log file) extensions.Use Visual Studio’s SQL Server Object Explorer
Fire up Visual Studio 2017, head to the menu bar and select View > SQL Server Object Explorer. Expand the SQL Server node, then look for instances like(LocalDB)\MSSQLLocalDBor your local SQL Express installation. Expand the instance, then the Databases folder—your Identity Server user database should be listed here (it’ll match the name from your connection string).Review Package Manager Console history
If you ran database migrations via the Package Manager Console (using commands likeUpdate-Database), scroll back through the console’s output logs. You’ll find details about the database creation process, including the full connection string and sometimes the physical file path if it’s a LocalDB or SQL Express database.
内容的提问来源于stack exchange,提问作者user9447717

