.netgoogle-cloud-platformgoogle-compute-enginegoogle-cloud-visualstudio

Publish Asp.Net using Google Tools - Web.config transformation


I'm using the Google Cloud Platform Extesion for visual studio in order to publish an Asp.Net web app.

As explained in the following tutorial: https://cloud.google.com/dotnet/docs/getting-started/hello-world

enter image description here

It works fines, but I couldn't publish this Asp.Net with different transformation of the web.config.

Say I have Web.QA.config transformation and I select the QA configuration. When publishing using visual studio to some local folder or an IIS it works as expected. But when using the Google cloud extension and publish to the Google environment it always publish without transformation, meaning with the web.config configuration.

Anything that can be done?


Solution

  • The Visual Studio extension cannot presently apply a transformation. I filed an issue here: https://github.com/GoogleCloudPlatform/google-cloud-visualstudio/issues/619

    In the meantime, there is a work-around.

    In the Google Cloud Explorer window in Visual Studio, right-click your aspnet instance and choose Save publish settings....

    Context menu

    After saving a .publishsettings file, in the Solution Explorer window, right-click your project and choose Publish...

    enter image description here

    Click Import and browse to the .publishsettings file you just saved.

    enter image description here

    Finally, in the Publish dialog, choose the desired configuration, and click Publish.enter image description here