dotnet / dotnet/sdk

dotnet run app.cs causes NU1100

Open
#50,781 6 comments 0 reactions 1 assignee Claimed by @jjonescz View on GitHub
Area-run-file untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Describe the bug
On a fresh installation (clean machine), `dotnet run app.cs` fails to restore nuget dependencies

### To Reproduce
1. on a clean computer, install .NET SDK version 10 RC1
2. create a simple file named `app.cs` with the following content (details should actually be irrelevant)
```
Console.WriteLine("hello world");
```
3. run `dotnet run app.cs`, then the build fails with
```
C:\Users\testuser\Desktop\app.csproj : error NU1100: Unable to resolve 'Microsoft.DotNet.ILCompiler (>= 10.0.0-preview.7.25380.108)' for 'net10.0'.
C:\Users\testuser\Desktop\app.csproj : error NU1100: Unable to resolve 'Microsoft.NET.ILLink.Tasks (>= 10.0.0-preview.7.25380.108)' for 'net10.0'.
C:\Users\testuser\Desktop\app.csproj : error NU1100: Unable to resolve 'runtime.win-x64.Microsoft.DotNet.ILCompiler (= 10.0.0-preview.7.25380.108)' for 'net10.0'.
```

I assume that the reason is because there are no nuget sources available (confirmed via `dotnet nuget config get ALL --show-path` and `dotnet nuget list source`) and the nuget caches are empty. The file %USERPROFILE%\nuget.config does not exist - and once I add one (with https://api.nuget.org/v3/index.json as a packages source) everything works as expected.

### Further technical details
details of dotnet --info


.NET SDK:
Version: 10.0.100-rc.1.25451.107
Commit: 2db1f5ee2b
Workload version: 10.0.100-manifests.0e2d47c4
MSBuild version: 17.15.0-preview-25451-107+2db1f5ee2

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.100-rc.1.25451.107\

.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.

Host:
Version: 10.0.0-rc.1.25451.107
Architecture: x64
Commit: 2db1f5ee2b

.NET SDKs installed:
10.0.100-rc.1.25451.107 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 10.0.0-rc.1.25451.107 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.0-rc.1.25451.107 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.0-rc.1.25451.107 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
Not found

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.