question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Errors in dev env on MacOS in launchSettings.json

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
rockstardevcommented, Mar 25, 2020

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

2reactions
Eskyeecommented, Mar 22, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio for Mac Ignoring launchSettings.json
I have service which is written in C# and I am trying to run it from visual studio for Mac. I can see...
Read more >
Use multiple environments in ASP.NET Core
The environment for local machine development can be set in the Properties\launchSettings.json file of the project. Environment values set ...
Read more >
Launch Profile Initializer incorrectly reporting errors
Sdk.Web we get the following error: Launch Profile Initializer. Unable to parse the launchSettings.json file.
Read more >
How to set the hosting environment in ASP.NET Core
In this post I'll show how to change the current hosting environment used by ASP.NET Core using environment variables on Windows and OS...
Read more >
Multiple Environments in ASP.NET Core
Let's take a look at the three most common environments: Development – We can use this environment to write code, commit code, fix...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found