How can I overwrite the `dotnet` executable locati...
# help
a
How can I overwrite the
dotnet
executable location that SST uses for running C# functions? I have an M1 Macbook and it requires some trickery to install .NET Core 3.1 involving putting it in a non-standard location from newer dotnet runtimes. I need to run some 3.1 Lambda functions within an SST project, but it can’t find the runtime. Is there a way to configure this executable location?
a
hmm, is this hardcoded somewhere (edit: as in cdk or sst)? I'd imagine the path to the executable comes from PATH or some similar global environment variable
however I don't have .NET experience, maybe something to look at
a
Yeah, I was actually able to resolve this by temporarily editing
process.env.PATH
in the SST stack code.
Actually this did not work after all. Still open to suggestions.
f
@Austin SST just spawns
dotnet
without specifying the path. ie. here and here.
If u run
which dotnet
in ur terminal, does that work for u?
a
@Frank I meant to update here; I got this working by setting updating PATH in my VS Code launch.json that runs
sst start
f
can u try exporting
Copy code
export PATH="/path/to/ur/dotnet:$PATH"
ah nice.. i have something like this set in my
~/.zshrc
Copy code
export PATH="/usr/local/lib/ruby/gems/3.0.0/bin:$PATH"
a
Yeah, the tricky bit is I want the dotnet 6 path to be “default”, but just want to override the path for dotnet 3 for specific projects.
f
ah got it! Glad it’s working