I created a Service Based-Database
But in your connection string you use "AttachDbFilename" for a SQL Server User-Instance; not service based DB: it should be "Initial Catalog" or "Database" parameter instead.
And the error is raised, because the database (file) already exists in SQL Server.
See https://www.connectionstrings.com/sqlconnection/