btcpayserver: Errors in dev env on MacOS in launchSettings.json

Describe the problem/bug When a dev enviroment is set up on MacOS, there is an issue with launchSettings.json.

When you build a project, it will automatically alter your launchSettings.json and then it’s considered as a change in the PR

Your environment

  • Version of BTCPay Server: Dev env
  • Deployment method: Docker, v3.1.102 SDK, GitHub Desktop

To Reproduce Steps to reproduce the behavior:

  1. Build a project on Mac.
  2. See that it changes parameters in launchSettings.json that never happens on Windows.

Expected behavior Project should build without any changes.

Actual behavior Building project changes file parameters.

Screenshots/Links Screenshot 2020-03-22 at 18 00 04

Screenshot 2020-03-22 at 18 08 22

Additional context Affected files from the screenshot above:

@ -50,4 +50,7 @@
    <ProjectReference Include="..\BTCPayServer\BTCPayServer.csproj" />
  </ItemGroup>

  <ItemGroup>
    <Content Remove="Properties\launchSettings.json" />
  </ItemGroup>
</Project>
  <PropertyGroup Condition=" '$(RunConfiguration)' == 'Docker-Regtest' ">
    <StartAction>Project</StartAction>
    <EnvironmentVariables>
      <Variable name="BTCPAY_NETWORK" value="regtest" />
      <Variable name="BTCPAY_LAUNCHSETTINGS" value="true" />
      <Variable name="BTCPAY_BUNDLEJSCSS" value="false" />
      <Variable name="BTCPAY_LTCEXPLORERURL" value="http://127.0.0.1:32838/" />
      <Variable name="BTCPAY_BTCLIGHTNING" value="type=clightning;server=tcp://127.0.0.1:30993" />
      <Variable name="BTCPAY_BTCEXTERNALLNDGRPC" value="type=lnd-grpc;server=https://lnd:lnd@127.0.0.1:53280/;allowinsecure=true" />
      <Variable name="BTCPAY_BTCEXTERNALLNDREST" value="type=lnd-rest;server=https://lnd:lnd@127.0.0.1:53280/lnd-rest/btc/;allowinsecure=true;macaroonfilepath=D:\admin.macaroon" />
      <Variable name="BTCPAY_BTCEXTERNALLNDSEEDBACKUP" value="../BTCPayServer.Tests/TestData/LndSeedBackup/walletunlock.json" />
      <Variable name="BTCPAY_BTCEXPLORERURL" value="http://127.0.0.1:32838/" />
      <Variable name="BTCPAY_ALLOW-ADMIN-REGISTRATION" value="true" />
      <Variable name="BTCPAY_DISABLE-REGISTRATION" value="false" />
      <Variable name="ASPNETCORE_ENVIRONMENT" value="Development" />
      <Variable name="BTCPAY_CHAINS" value="btc,ltc" />
      <Variable name="BTCPAY_POSTGRES" value="User ID=postgres;Host=127.0.0.1;Port=39372;Database=btcpayserver" />
      <Variable name="BTCPAY_DEBUGLOG" value="debug.log" />
      <Variable name="BTCPAY_TORRCFILE" value="../BTCPayServer.Tests/TestData/Tor/torrc" />
    </EnvironmentVariables>
    <ApplicationURL>http://127.0.0.1:14142/</ApplicationURL>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(RunConfiguration)' == 'Docker-Regtest-https' ">
    <StartAction>Project</StartAction>
    <EnvironmentVariables>
      <Variable name="BTCPAY_NETWORK" value="regtest" />
      <Variable name="BTCPAY_LAUNCHSETTINGS" value="true" />
      <Variable name="BTCPAY_PORT" value="14142" />
      <Variable name="BTCPAY_HttpsUseDefaultCertificate" value="true" />
      <Variable name="BTCPAY_BUNDLEJSCSS" value="false" />
      <Variable name="BTCPAY_LTCEXPLORERURL" value="http://127.0.0.1:32838/" />
      <Variable name="BTCPAY_LBTCEXPLORERURL" value="http://127.0.0.1:32838/" />
      <Variable name="BTCPAY_BTCLIGHTNING" value="type=clightning;server=tcp://127.0.0.1:30993" />
      <Variable name="BTCPAY_BTCEXTERNALLNDGRPC" value="type=lnd-grpc;server=https://lnd:lnd@127.0.0.1:53280/;allowinsecure=true" />
      <Variable name="BTCPAY_BTCEXTERNALLNDREST" value="type=lnd-rest;server=https://lnd:lnd@127.0.0.1:53280/lnd-rest/btc/;allowinsecure=true" />
      <Variable name="BTCPAY_BTCEXTERNALLNDSEEDBACKUP" value="../BTCPayServer.Tests/TestData/LndSeedBackup/walletunlock.json" />
      <Variable name="BTCPAY_BTCEXTERNALSPARK" value="server=/spark/btc/;cookiefile=fake" />
      <Variable name="BTCPAY_BTCEXTERNALCHARGE" value="server=https://127.0.0.1:53280/mycharge/btc/;cookiefilepath=fake" />
      <Variable name="BTCPAY_EXTERNALCONFIGURATOR" value="passwordfile=testpwd;server=/configurator" />
      <Variable name="BTCPAY_BTCEXPLORERURL" value="http://127.0.0.1:32838/" />
      <Variable name="BTCPAY_ALLOW-ADMIN-REGISTRATION" value="true" />
      <Variable name="BTCPAY_DISABLE-REGISTRATION" value="false" />
      <Variable name="ASPNETCORE_ENVIRONMENT" value="Development" />
      <Variable name="BTCPAY_CHAINS" value="btc,ltc,lbtc" />
      <Variable name="BTCPAY_POSTGRES" value="User ID=postgres;Host=127.0.0.1;Port=39372;Database=btcpayserver" />
      <Variable name="BTCPAY_EXTERNALSERVICES" value="totoservice:totolink;" />
      <Variable name="BTCPAY_SSHCONNECTION" value="root@127.0.0.1:21622" />
      <Variable name="BTCPAY_SSHPASSWORD" value="opD3i2282D" />
      <Variable name="BTCPAY_DEBUGLOG" value="debug.log" />
      <Variable name="BTCPAY_TORRCFILE" value="../BTCPayServer.Tests/TestData/Tor/torrc" />
    </EnvironmentVariables>
    <ApplicationURL>https://localhost:14142/</ApplicationURL>
  </PropertyGroup>

I have no clue what happens here, I know @Eskyee reported this issue months ago and tried to troubleshoot it with @rockstardev but with no success, so leaving it here as a notice. It does not affect a workflow besides being annoying thing you always have to discard. Probably has to do something with the host.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 18 (18 by maintainers)

Most upvoted comments

This is known issue with Visual Studio on Mac… we can’t really do much other than allow your Mac installation to overwrite everything it wants to overwrite and then we test that our other IDEs won’t do any automatic changes.

Link that describes issue: https://developercommunity.visualstudio.com/content/problem/833426/launchsettingsjson-is-always-overwritten.html

Lol 😂 thank you Pav, Thought I was going mad, had this problem like three months, nightmare on a Mac 💻 told Rockstar Kukks and Nicolas about this Bug , you will also find a double Json file sometimes in vs !! BTCPay/ Property’s folder !! This has been a pain in my side lol 😝 launchSettings.json good luck 😉 this dup does not happen in Visual Studio Code… Just VS I must of been the only person to see this !! Bug, I made a issue on this , already before

Closing this after trying out Rider, it’s a bug in Visual Studio as @rockstardev told, pretty much nothing we can do about it on our end.

I`m using Visual studio code, and these problems above, don’t exist, only Visual Studio giving these bugs on a Mac, thanks Rockstar!!

Related #1042