6

I have a transform for my web.config that currently works if I publish to Azure, but it's not working locally when I build/run. How can I go about "Publishing" locally so the Local transformations are applied to my web.config on my dev box?

Currently I right-click > publish to Azure, do I need to create a new publish profile for my local box? Is there any way to get the transforms to work on Build instead?

1

1 Answer 1

7

It depends on which dev server you are using. As @Citronas said on this answer:

It depends on how you debug. If you are using Cassini, afaik your web.config contents will be read regardless of the selected solution configuration (e.g. Debug or Release).

If you are debugging with your local IIS, it depends on what you have set the path in the IIS to. If you have set it to your source code directory, you need to write your local settings into your web.config. If you publish your code into a local directory and set the IIS path accordingly, you can use web.config transforms. (You said, that your web.config transforms are working)

You do not need to publish locally (even though you can do that, publish to local IIS then attach the debugger to the worker process of the application pool) since it is annoying. The easiest way is to simple have your debug settings in the web.config file and then apply transforms for your "publishable" environments.

In short: do not use transforms for debug, only for publishing. Use the regular web.config to debug.

0

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.