Skip to content

Make VS2019 a prerequisite, and add scripts to set required env vars#1038

Merged
natemcmaster merged 3 commits into
dotnet:masterfrom
natemcmaster:vs2019
Jan 31, 2019
Merged

Make VS2019 a prerequisite, and add scripts to set required env vars#1038
natemcmaster merged 3 commits into
dotnet:masterfrom
natemcmaster:vs2019

Conversation

@natemcmaster
Copy link
Copy Markdown

Changes:

  • Update Extensions.sln to require VS 2019.
  • Add two scripts (inspired by Python's virtualenv) which set required environment variables so you can use dotnet and launch VS Code on command line. I did this because Arcade puts dotnet core in "$repoRoot/.dotnet" by default now.

Copy link
Copy Markdown

@ryanbrandenburg ryanbrandenburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, :shipit: if you've tested locally.

Comment thread activate.ps1

$_OLD_PATH = $env:PATH
# Tell dotnet where to find itself
$env:DOTNET_ROOT = "$PSScriptRoot\.dotnet"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For an individual user building locally, don't we want $env:UserProfile\.dotnet? This seems to require re-activating whenever a dev moves from their aspnet/Extensions repo to aspnet/AspNetCore and back.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For an individual user building locally, don't we want $env:UserProfile.dotnet?

I wish that were the case, but that's not the default Arcade chose. Aracde installs to "$repoRoot/.dotnet". So yes, you have to reactivate to update PATH when moving between repos. 😞

@dougbu
Copy link
Copy Markdown

dougbu commented Jan 31, 2019

Should the requirement also be included in global.json?

@natemcmaster
Copy link
Copy Markdown
Author

AFAIK the only thing Visual Studio and dotnet.exe reads from global.json is SDK version. The other data in that file is used by other tooling and scripts, like MSBuild and Arcade.

https://github.com/aspnet/Extensions/blob/8535a13651cde6d28ee7059c7d8e5ecb5f384f42/global.json#L2-L4

Copy link
Copy Markdown

@Eilon Eilon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know what the code does, but the concept looks good. Docs look good too.

@natemcmaster natemcmaster merged commit 56b843e into dotnet:master Jan 31, 2019
@natemcmaster natemcmaster deleted the vs2019 branch January 31, 2019 21:47
@poke
Copy link
Copy Markdown

poke commented Feb 5, 2019

@natemcmaster Hey, I was wondering if the VS 2019 requirement is a hard requirement, or if there was a way to get this into a buildable state with VS 2017 too. I tried lowering the requirement in the sln and was able to load the solution properly but then I got an error that the “current .NET SDK does not support targeting .NET Standard 2.0.” I did activate the environment for VS, so the 3.0 SDK should be there?

The reason I’m asking is because I don’t really want to waste another 5+ gigabytes on multiple machines for a VS that I’m not going to use otherwise. And I have been able to use 2017 for both Extensions and AspNetCore just fine before the move to Arcade. I just called build.ps1 back then and launched VS from the console to inherit the environment variables the build script set up.

@natemcmaster
Copy link
Copy Markdown
Author

I was wondering if the VS 2019 requirement is a hard requirement,

Yes, it is. We are also updating AspNetCore to require VS2019. (see dotnet/aspnetcore#7005)

@ghost ghost locked as resolved and limited conversation to collaborators May 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants