How to transform entity-infrastructure to use web.config transformations?

When applying any commands, for example

  • 'database update'
  • 'migration add-in'

EF uses the connection string in your main web.config

even if you configured web.debug.config and web.release.config with xml conversion

This means that I must go in and risk forgetting to change my true one web.configbefore graduation.

+3
source share
1 answer

I think the only way to run web.config transforms locally is to use MSBuild with the following parameters, where [YourTransformationConfiguration] is the name of the configuration you are using, for example. Debug or release:

msbuild PathToProject /T:Package /P:Configuration=[YourTransformationConfiguration] /P:AutoParameterizationWebConfigConnectionStrings=False

:

[ProjectFolder]\obj\[YourTransformationConfiguration]\Package\PackageTmp

migrate.exe , Update-Database PowerShell script. Nuget, tools EntityFramework. , " " :

Migrate.exe

+3

All Articles