Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet new -i 404 (Not Found). #1485

Closed
livarcocc opened this issue Mar 23, 2018 · 3 comments
Closed

dotnet new -i 404 (Not Found). #1485

livarcocc opened this issue Mar 23, 2018 · 3 comments

Comments

@livarcocc
Copy link
Contributor

From @aguacongas on March 23, 2018 9:44

Steps to reproduce

  • Install SDK v2.1.300-preview1-008174
  • run dotnet new -i Microsoft.AspNetCore.Blazor.Templates
C:\Projects\Perso\aspnet samples\samples\aspnetcore\blazor\FlightFinder>dotnet new -i Microsoft.AspNetCore.Blazor.Templates
  Restoring packages for C:\Users\LefebvreO\.templateengine\dotnetcli\v2.1.300-preview1-008174\scratch\restore.csproj...
  Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.ne.ch/api/odata/FindPackagesById()?id='Microsoft.AspNetCore.Blazor.Templates''.
  Response status code does not indicate success: 404 (Not Found).
  Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.ne.ch/api/odata/FindPackagesById()?id='Microsoft.AspNetCore.Blazor.Templates''.
  Response status code does not indicate success: 404 (Not Found).
C:\Program Files\dotnet\sdk\2.1.300-preview1-008174\NuGet.targets(114,5): error : Failed to retrieve information about 'Microsoft.AspNetCore.Blazor.Templates' from remote source 'https://nuget.ne.ch/api/odata/FindPackagesById()?id='Microsoft.AspNetCore.Blazor.Templates''. [C:\Users\LefebvreO\.templateengine\dotnetcli\v2.1.300-preview1-008174\scratch\restore.csproj]
C:\Program Files\dotnet\sdk\2.1.300-preview1-008174\NuGet.targets(114,5): error :   Response status code does not indicate success: 404 (Not Found). [C:\Users\LefebvreO\.templateengine\dotnetcli\v2.1.300-preview1-008174\scratch\restore.csproj]

Templates                                         Short Name       Language          Tags
--------------------------------------------------------------------------------------------------------
Console Application                               console          [C#], F#, VB      Common/Console
Class library                                     classlib         [C#], F#, VB      Common/Library
Unit Test Project                                 mstest           [C#], F#, VB      Test/MSTest
xUnit Test Project                                xunit            [C#], F#, VB      Test/xUnit
ASP.NET Core Empty                                web              [C#], F#          Web/Empty
ASP.NET Core Web App (Model-View-Controller)      mvc              [C#], F#          Web/MVC
ASP.NET Core Web App                              razor            [C#]              Web/MVC/Razor Pages
ASP.NET Core with Angular                         angular          [C#]              Web/MVC/SPA
ASP.NET Core with React.js                        react            [C#]              Web/MVC/SPA
ASP.NET Core with React.js and Redux              reactredux       [C#]              Web/MVC/SPA
ASP.NET Core Web API                              webapi           [C#], F#          Web/WebAPI
global.json file                                  globaljson                         Config
NuGet Config                                      nugetconfig                        Config
Web Config                                        webconfig                          Config
Solution File                                     sln                                Solution
Razor Page                                        page                               Web/ASP.NET
MVC ViewImports                                   viewimports                        Web/ASP.NET
MVC ViewStart                                     viewstart                          Web/ASP.NET

Examples:
    dotnet new mvc --auth Individual
    dotnet new console
    dotnet new --help

Expected behavior

The command should install the template with the default nuget source

Actual behavior

The command fail if we don't specify the nuget source.
We need to specify --nuget-source :

dotnet new -i Microsoft.AspNetCore.Blazor.Templates --nuget-source https://api.nuget.org/v3/index.json

Environment data

dotnet --info output:

.NET Command Line Tools (2.1.300-preview1-008174)

Product Information:
 Version:            2.1.300-preview1-008174
 Commit SHA-1 hash:  b8df89a54f

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.1.300-preview1-008174\

Microsoft .NET Core Shared Framework Host

  Version  : 2.1.0-preview1-26216-03
  Build    : f2c3216183d20416568a4bbf5bb7d153e826f153

If I specified the nuget source it works

Copied from original issue: dotnet/cli#8883

@mlorbetske
Copy link
Contributor

From the error & from the fact that passing the package source directly works, there seems to be a NuGet.config file somewhere above the .templateEngine directory in your user profile that indicates that that source should be used (and cannot be found). I'd suggest removing the missing feed from the NuGet.config as the failure to restore with unreachable feeds in use is by design for NuGet NuGet/Home#5607

@aguacongas
Copy link

aguacongas commented Mar 26, 2018

@mlorbetske I did not find any NuGet.config above %userprofile%\.templateEngine on my machine...
But my default nuget.config in %userprofile%\AppData\Roaming\NuGet contains the url to our internal feed:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="CliFallbackFolder" value="%userprofile%\.dotnet\NuGetFallbackFolder" />
    <add key="SIEN" value="https://nuget.ne.ch/api/odata" />
  </packageSources>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <bindingRedirects>
    <add key="skip" value="False" />
  </bindingRedirects>
</configuration>

In my opinion, that souldn't be an issue

@mlorbetske
Copy link
Contributor

Unfortunately, the error you’re seeing is from NuGet and is related to not being able to reach that feed. Following up on the referenced issue would be the best course of action for pursuing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants