In Visual Studio, select the File | Open | File menu command and navigate to the project directory and then to obj\Staging\TransformWebConfig\transformed folder. Select the Web.config file and click Open. Notice that in the Web.config file the value for key EnvironmentName has changed to Staging and the connection string has been updated from (local) to QADatabaseServer. XML <appSettings> <add key="EnvironmentName" value="Staging" /> </appSettings> <connectionStrings> <add name="LoggingConnectionString" connectionString="Server=QADatabaseServer;Database=Logger;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/> </connectionStrings> Close the Web.config file. Task 6 – Generating a Transformed Web.config File from Visual Studio In this task, you will use Visual Studio to create a build to transform the Web.config file as part of that build. In the Solution Explorer, right-click the HTMLLab project and select Properties. On the project properties page, click the Package/Publish Web tab. At the top of the properties page, make sure that the active configuration is set to Staging: Figure 21 Verify that the Staging configuration selected. At the bottom of the properties page, uncheck the Create deployment package as a zip file checkbox. Figure 22 Uncheck the deploy as a ZIP file box Note: If Create deployment package as a zip file checkbox is left checked, the same build will occur but in addition, Visual Studio will create a ZIP file.
In Visual Studio, select the File | Open | File menu command and navigate to the project directory and then to obj\Staging\TransformWebConfig\transformed folder. Select the Web.config file and click Open. Notice that in the Web.config file the value for key EnvironmentName has changed to Staging and the connection string has been updated from (local) to QADatabaseServer. XML <appSettings> <add key="EnvironmentName" value="Staging" /> </appSettings> <connectionStrings> <add name="LoggingConnectionString" connectionString="Server=QADatabaseServer;Database=Logger;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/> </connectionStrings> Close the Web.config file. Task 6 – Generating a Transformed Web.config File from Visual Studio In this task, you will use Visual Studio to create a build to transform the Web.config file as part of that build. In the Solution Explorer, right-click the HTMLLab project and select Properties. On the project properties page, click the Package/Publish Web tab. At the top of the properties page, make sure that the active configuration is set to Staging: Figure 21 Verify that the Staging configuration selected. At the bottom of the properties page, uncheck the Create deployment package as a zip file checkbox. Figure 22 Uncheck the deploy as a ZIP file box Note: If Create deployment package as a zip file checkbox is left checked, the same build will occur but in addition, Visual Studio will create a ZIP file.
WebDevelopment.docx