Visual Studio Mac - Changing Environment - visual-studio-mac

I'm trying to change the environment config in VS for Mac. In Windows, beside the project, you get a configuration drop down that specifies which environment you want to connect to (connected to launchsettings.json). This isn't available in VS for Mac, and I can't seem to figure out how to set it up.
I've added an ASPNETCORE_ENVIRONMENT variable, but this doesn't seem to change anything. My app is still running against production, even though I'd like it to run against my local database:

Related

Where to set up environment variables for development purpose?

Is there any "standards" way to set up environment variables during development? Like database connect string as environment variable, package manager proxies and the like.
Sure I know of .bashrc, .profile, Windows Gui, launch.json of VSCode, tool-specific settings-files.
But isn't there any more standard? BTW I do not develop within Docker containers.

'daprd' is not recognized as an internal or external command, operable program or batch file

I am trying to debug a huge project using VS Code, the project is supposed to run on dapr using docker. I have installed dapr, docker, both seem to work fine. I also have VS Code, and I managed to get dapr extension for VS Code.
I build the project using dotnet build, no errors, so I am assuming that works fine, but when I try to debug it (run it) I get that error. I have read that it can be caused by having to set up environmental variables, but I don't know which environmental variables, as they seem to be present in the path (c:\users\myself.dapr\bin) is present.
So I have a few questions: what should I do now? and what is the reason behind it? Basically, I want to fix this, but knowing and understanding how, thanks.
As simple as restarting the laptop fix it, I guess that I did all of the installations without restarting and it needed a restart.
It was nothing to do with the environment variables in the end.

How to change file permissions in localhost Windows 10 pro/docker/ddev container for Drupal site?

I have installed a drupal 8.8 site using Composer on a Windows 10 pro system and docker and ddev as the development environment.
The drupal site seems to be functioning normally: I see no errors in the drupal log nor when I run ddev describe.
The only exception: Drupal gives me a warning that sites/default/settings.php needs to be write protected. In the past I have done this on a live site using Filezilla, but this is a development only site and it seems Filezilla does not apply permissions on local files--at least, when I right-click the file locally, I do not find a command for changing permissions.
I tried changing the write permissions with Windows 10 itself, but that did not seem to have any effect--I suspect for windows those are different kinds of permissions.
I poked around online and saw something that made me think I could use phpmyadmin to change permissions. Got caught up in that and struggled with it, until getting some help here (How to access phpmyadmin on DDEV Windows 10 pro localhost with SSL record too long error) but it turns out you can't change file permissions with phpmyadmin, apparently.
I tried to use the address that connected me to phpmyadmin in my browser to connect with Putty, but Putty tells me the host does not exist.
So the help I am looking for: how can I change file permissions for sites/default/settings.php in Windows 10 pro localhost running docker/ddev development environment for my drupal site?
Thank you!
I assume you're talking about this warning?
First, you can ignore this warning completely. You're on a local development environment, and so you shouldn't have any concerns about the permissions of settings.php.
Unfortunately, in a Windows environment, you can't make simple permissions changes as Drupal 8 is suggesting that you do.
Note that settings.ddev.php explicitly provides the skip_permissions_hardening option, $settings['skip_permissions_hardening'] = TRUE; to tell Drupal 8 not to try to change permissions on sites/default and sites/default/settings.php because it's just a dev environment and because when Drupal does these things it just makes things harder.
However, to make most things easier on Windows (doesn't solve that problem)...
Use nfs_mount_enabled
I see there are loads of problems with the new "official" Drupal 8.8.0 composer build on Windows. Most of them are due to the composer build making some assumptions about the ability to set time and ownership, but the docker mount used by default (CIFS) has everything owned by root, so the container can't change permissions (even thought they're wide open).
I found that I could get by all of these things by using NFS to mount into the container, and you'll also find it improves performance quite a lot. Set up for NFS by following the instructions at https://ddev.readthedocs.io/en/stable/users/performance/#windows-nfs-setup

Can't access env vars from ANT after OS upgrade

A server was upgraded from Windows 2000 to Windows 2003 and now I can't access environment variables from Ant build scripts.
I can still access them fine from a command line, but ${env.JAVA_HOME} for instance fails.
How can I fix this without rewriting ~100 build scripts that work on all other servers to be customized for this server?
Unfortunately I don't think you should have been using that environment variable. To get around such problems there's the builtin ${java.home} you could have been using, which isn't dependent on the operating system and/or user's environment being setup properly. (See the Ant manual discussion of built-in properties in Ant.)
You may be able to get around rewriting all your build scripts by either (1) setting the JAVA_HOME environment variable manually, or (2) modifying the ant.bat file to assign it manually. Both options are brittle because they'll break when Java gets upgraded, but at least they'll likely fail fast.

Cannot get the remote debugger for Delphi 2007 to work correctly?

I followed these instructions while trying to get remote debugging working with Delphi 2007. After completing all the steps, the remote debugger is half working.
It is able to launch and halt the application but the break points I set do not work. The automatic break point (at line Application.Initialize;) is working but it goes right to the CPU window. The debugging information appears to be missing.
I triple checked, both 'Include TD32 debug info' and 'Include remote debug symbols' are checked, a clean build was performed, and the correct files have been moved to the remote machine.
What am I missing?
Any help would be greatly appreciated.
You might like to go through my own checkist for this, which is as follows. I hope its not too patronising, but there may be a step you've omitted. I also seem to recall that it was improtant to use IP addresses, not names. Also note that these instructions are for D7, howver I'm not aware that the principle has changed.
=======
In this description, TARGET refers to the machine being debugged (i.e the remote machine) and HOST refers to the machine being used fro debugging (i.e the local machine).
If necessary, install the remote debugger on the target by copying the RDEBUG folder to the target and running SETUP.
Run the remote debugger locally on the target using Start | Borland Remote Debugger | Remote debugger. A ‘spider’ icon should appear in the task bar. (It can be useful to double-click on this icon to obtain a connection status dialog – this shows how the local IDE is connecting to the remote in later steps here).
On the host machine, explode the project to be debugged. Check that this compiles locally and runs offline.
By convention, copy the SOFTWARE ROOT folder from the host to the target. This will be the working folder for the application when debugged. By copying the folder in its entirety, all support files will be found locally as needed. (This also fits nicely with using SecondCopy to duplicate the entire ART software tree on a remote machine and then to explode the required project – this will create the remote folder for you).
In the Delphi IDE on the local machine, use Run | Parameters | Remote to set the Remote Path to the remote exe file in the folder you have just copied, as it will be visible on the target machine. If you’ve copied it as instructed in ‘4’, this path will be identical to the file that the local IDE would create and debug, eg “C:\Art_Soft\RT290\Bench\Dev4all\RT290w.exe”
In the Delphi IDE on the local machine, use Run | Parameters | Remote to set Remote Host to the IP address of the target (you should use IPCONFIG on the target to find out what the IP address is). Before leaving the dialog, select ‘Debug Project On Remote Machine’.
Enable “Include remote debug symbols” on the “EXE and DLL options” pane under Project|Options|Linker
Compile and run the file from the IDE. The remote connection status should show connection progress and a the remote screen should show the application running.
What are the correct files? I assume both the .exe and .rsm file?
(disclaimer: I only know remote debugging in D2009)

Resources