.NET Core sdk installed on every build

Hello,

when building with .NET Core using multiple steps, Travis-CI reinstalls the .NET Core sdk every time.
Secondly it does seem to ignore the flags DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 and DOTNET_CLI_TELEMETRY_OPTOUT=1.

There was originally an issue on github that has been closed but I didn’t seem to find it here.

Any help would be very much appreciated since this is causing the build time to be quite long.

Kind regards,
Sami

1 Like

Hello,
I’ve seen the same issue.
First build on travis, 2min just for a dotnet build… it’s pretty long! :smile:

As we’re not able to add env var for the installation, we even can’t test or workaround it.
Or, well, we can workaround it by pulling mcr.microsoft.com/dotnet/core/sdk:2.2-alpine docker image and running scripts in it, but I don’t know if it’s as easy to do with Travis as in Gitlab CI.

Ayust

1 Like

Yeah I thought about that too but I’d prefer not to do so. I can live with the build-time, just thought there might be a way to improve it that I don’t know of (yet).

Kind regards,
Sami

Hi,

cc @Joshua-Anderson

It’s been a while now.
Any workaroung to fix this?

Regards,
Ayust

Travis-CI spins up a fresh virtual machine on every build, so we have to re-install .Net Core every time.
Short of pre-installing C# on the virtual machine image, which isn’t possible right now (Travis-CI tries to minimize the amount of software preinstalled on the image), I don’t think there’s much we can do.

My guess is that sudo is not preserving the exported variables set on lines 131 and 134.

It looks like it should be a simple fix, but I don’t have the time to set up a build environment to fix and test it.

Well, the alpha Windows builds have some of this pre-installed already. Might be useful … :wink:
https://docs.travis-ci.com/user/reference/windows/#pre-installed-chocolatey-packages