2

My appsetting.json file contains :

"ConnectionStrings": {
    "Server=localhost;Database=db;Trusted_Connection=True;encrypt=false;MultipleActiveResultSets=true"
 }

After migration to .NET 7 and EF Core 7, new default value for encrypt is true.

But, publishing from Visual Studio removes this 'encrypt=false;' section from connection string and app can't be run until I manually change the connection string.^

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
mordechai
  • 829
  • 1
  • 7
  • 23
  • Sorry, can you explain the exact steps to reproduce it? – Jiale Xue - MSFT Mar 06 '23 at 09:34
  • after each publish,there is new file 'appsettings.production.json' in destenation folder. this file does not exists in original folder, but generated on publish process from 'appsettings.json'. the specific section is missing. – mordechai Mar 06 '23 at 10:44
  • 1
    @mordechai can you please post a full [mre]? – Guru Stron Mar 06 '23 at 13:09
  • 1
    thanks to @Guru Stron, on the way for making an short example, I have found the simple value 'DestinationConnectionStrings- default connection' in('xx.pubxml.user') that cause the problem. – mordechai Mar 09 '23 at 11:57

0 Answers0