Comments (9)
We should prepend DOTNET
to our ENVs wherever we can. NUGET
is sufficient for that, IMO.
We want to:
- Avoid collisions with our ecosystems.
- Make it easy for others to self-identify that a given ENV is for a given dev plat when someone inspects the result of
set
orexport
. DOTNET
ENVs all appear/sort together.
We should also decide if we want DOTNET_SDK_BLAH
.
from home.
We'll discuss this in today's triage
from home.
Two things came from our discussion:
- We're fine with respecting
GLOBAL_JSON
or whatever, just get consensus from the .NET folks on the name (like should it beDOTNET_GLOBAL_JSON
or whatever - We'd like the implementation of respecting both
GLOBAL_JSON
and especiallyNUGET_CONFIG
to log something to indicate that the environment variable is set and its side effect. So at the end of restore, NuGet has a summary:
NuGet Config files used:
C:\Users\jeffkl\AppData\Roaming\NuGet\NuGet.Config
C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
Feeds used:
https://api.nuget.org/v3/index.json
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
If that summary said something like "Used D:\Something\NuGet.config because it was specified in the NUGET_CONFIG environment variable", that would be great. We're very afraid of adding this magic and it not being obvious to users of the side effect. We've personally experienced cases where an environment variable is set and can't for the life of us figure out why something isn't working. Informing the user at the end of restore will greatly help them from scratching their heads when restore is using an unexpected config.
from home.
Respecting GLOBAL_JSON
is a no brainer. @nkolev92 what do you think about an environment variable NUGET_CONFIG
that simply overrides the path to NuGet.Config, skipping the search for it in parent folders?
from home.
I feel like the concerns of the SDK resolver and NuGet in general are slightly different.
The SDK resolver respecting GLOBAL_JSON seems like an easy one I agree, since it doesn't really affect NuGet as a whole.
I've been a fan of having a single way to specify config file, but env vars are not ideal due to lack of transparency.
What are the commands that are missing a restore config file? Would having a resolver specific solution work or are there other scenarios to consider?
from home.
The nuget sdk resolver reads the global.json and NuGet.config file and doesn't have access to msbuild properties or CLI flags as it is loaded by the SDK.
What are the commands that are missing a restore config file? Would having a resolver specific solution work or are there other scenarios to consider?
Yes, this only affects the nuget sdk resolver. Other components respect the RestoreConfigFile msbuild property.
from home.
I think plumbing the fact that an env var is being used in the summary might be more challenging.
Personally, I'm fine if it's in the standard log
from home.
FYI ...
rich@mazama:~$ cat global.json
{
"sdk": {
"version": "8.0.100"
}
}
rich@mazama:~$ export DOTNET_ROOT=/home/rich/dotnet
rich@mazama:~$ dotnet --info
.NET SDK:
Version: 8.0.102
Commit: b7800db369
Workload version: 8.0.100-manifests.03fa9662
Runtime Environment:
OS Name: ubuntu
OS Version: 23.10
OS Platform: Linux
RID: ubuntu.23.10-x64
Base Path: /usr/lib/dotnet/sdk/8.0.102/
.NET workloads installed:
Workload version: 8.0.100-manifests.03fa9662
There are no installed workloads to display.
Host:
Version: 8.0.2
Architecture: x64
Commit: 1381d5ebd2
.NET SDKs installed:
8.0.102 [/usr/lib/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.2 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.2 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
DOTNET_ROOT [/home/rich/dotnet]
global.json file:
/home/rich/global.json
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
from home.
Ok, NUGET_CONFIG
and DOTNET_GLOBAL_JSON
it is then. I will explore what needs to change to indicate that these env var overrides are used.
from home.
Related Issues (20)
- [Bug Bash] Expected error disappear and restore will be successful after the TLS certificate validation is re-enabled HOT 2
- Explicitly enabling NuGet audit leads to incorrect NU1008 errors HOT 1
- ProjectReference causing PM UI to error with "Value cannot be null. Parameter name: frameworkIdentifier"
- Navigation telemetry for Owner Profile URLs in PM UI
- Document source-only packages HOT 1
- NuGet discovers credentials providers installed using .NET tools HOT 1
- NuGet executes credentials providers installed using .NET tools
- [Epic] Support for credential providers deployed via .NET tools HOT 1
- Add msbuild extension point after Directory.Packages.props is imported HOT 1
- Collect telemetry for HTTPS sources with HTTP resources
- An item with the same key has already been added restoring in Visual Studio when two projects have the same name HOT 1
- Version conflict with Nuget.Frameworks.dll in .Net SDK 8.0.401
- Wrong version in API V3
- NU1503 Warning documentation is lacking information
- Navigation telemetry for hyperlinks: License, ReportAbuse, Readme, ProjectUrl
- NuGet Error: Unable to parse version value '2.0.0-beta.3' from 'packages.config HOT 2
- NuGet client (via dotnet SDK) incorrectly warns about vulnerable NuGet packages hoisted by the shared runtime HOT 4
- Report real transitive reference versions in `dotnet nuget why`, not final resolved versions
- Allow packages to suppress NuGetAudit warnings from their transitive dependencies HOT 2
- [Bug Bash] Only one error NU1004 displays in Error List window with the solution contains multiple non-SDK projects after restoring with enabled “RestoreLockedMode”
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from home.