dotnet / dotnet-template-samples

Samples showing how to create templates using the Template Engine for dotnet new and Visual Studio

Home Page:https://docs.microsoft.com/dotnet/articles/core/tools/dotnet-new

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`dotnet new -i` fails when I try to point to filesystem

wes-goulet opened this issue · comments

commented
  1. Clone the repo
  2. cd dotnet-template-samples/01-basic-template/MyProject.Con
  3. dotnet new -i .

Fails to install the template, just gives me about a hundred lines of warnings like:

Restoring packages for /Users/user1/.templateengine/dotnetcli/v2.0.3/scratch/restore.csproj...
/usr/local/share/dotnet/sdk/2.0.3/NuGet.targets(102,5): warning : The folder '/usr/local/share/dotnet/sdk/NuGetFallbackFolder/.tools' contains an invalid version. [/Users/user1/.templateengine/dotnetcli/v2.0.3/scratch/restore.csproj]

and then at the end it gives me the error:

/Users/user1/.templateengine/dotnetcli/v2.0.3/scratch/restore.csproj : error NU1101: Unable to find package .. No packages exist with this id in source(s): /usr/local/share/dotnet/sdk/NuGetFallbackFolder, nuget.org
  Generating MSBuild file /Users/user1/.templateengine/dotnetcli/v2.0.3/scratch/obj/restore.csproj.nuget.g.props.
  Generating MSBuild file /Users/user1/.templateengine/dotnetcli/v2.0.3/scratch/obj/restore.csproj.nuget.g.targets.
  Restore failed in 596.09 ms for /Users/user1/.templateengine/dotnetcli/v2.0.3/scratch/restore.csproj.

This repros on both Windows and macOS for me.

compy386:MyProject.Con user1$ dotnet --info
.NET Command Line Tools (2.0.3)

Product Information:
 Version:            2.0.3
 Commit SHA-1 hash:  eb1d5ee318

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.12
 OS Platform: Darwin
 RID:         osx.10.12-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.0.3/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.3
  Build    : a9190d4a75f4a982ae4b4fa8d1a24526566c69df
commented

@sayedihashimi I opened this issue here, but it's not actually an issue with the samples, this bug really belongs in the dotnet CLI repo, just not sure where that is

@wes565 please file the issue at https://github.com/dotnet/templating/issues/ closing this one.