1

I've added the line

static private readonly string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings[0].ConnectionString;

to my Console App project, and it returns a connection string despite the fact that I haven't yet set one up, and there is no config file anywhere in the solution folder.

It appears to be an ASP.NET database connection string:

data source=.\\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true

Where is VS getting this string from?

0

1 Answer 1

2

I think this has been answered in full here: Autogenerated Default Connection

Essentially it's a default from Machine.Config.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.