Continuous integration TFS/Azure and Connection string in app.config

Asked

Viewed 94 times

0

I have a project composed of two subprojects, one of those subprojects is a Class Library, responsible for database connection activities. I am using Entity Framework as a ORM tool.

In the archive app.config, I have the following string Connection:

<connectionStrings>
        <add name="DB.Context" providerName="System.Data.SqlClient"
             connectionString="Integrated Security=SSPI;Initial Catalog=DB.Context;Data Source=(LocalDb)\v11.0;" />
    </connectionStrings>

Nothing too complex, just points to a local database.

However, at the time of deploying this application for production (by publishing from the Azure version control), I cannot get this string Connection automatically updated to point to the production BD. I have the connection string configured on my panel:

inserir a descrição da imagem aqui

How can I get the connection string present in app.config is updated during publication from TFS in Azure?

2 answers

1

1


James,

The app.config does not transform during the deployment - Publishing process (there is how to do this, only via Visual Studio, but is not native until VS2013 version).

Your Connectiostring settings should be in the application, then on the web.config.

This is one of the reasons that there is no transformation in its continuous implementation.

  • Actually, after a long time I realized that I can leave these settings on the web.config, the Entity Framework solves well by pulling the information from there, even if it is located in a different project :)

  • @Tiagocésaroliveira cool that helped. If you agree, mark the answer that best helped your doubt so that others with the same doubt can take as guidance. (y)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.