ps-core-module-template icon indicating copy to clipboard operation
ps-core-module-template copied to clipboard

Install Fails

Open clmcgrath opened this issue 8 years ago • 10 comments

attempting to install in latest dotnet cli (2.1.3) fails and displays following errors

PS C:\pscore\test> dotnet new -i "FiftyProtons.Templates.PSCore::*"
  Restoring packages for C:\Users\Chris\.templateengine\dotnetcli\v2.1.3\scratch\restore.csproj...
C:\Users\Chris\.templateengine\dotnetcli\v2.1.3\scratch\restore.csproj : error NU1103: Unable to find a stable package FiftyProtons.Templates.PSCore with version
C:\Users\Chris\.templateengine\dotnetcli\v2.1.3\scratch\restore.csproj : error NU1103:   - Found 2 version(s) in nuget.org [ Nearest version: 0.1.0-alpha1 ]
C:\Users\Chris\.templateengine\dotnetcli\v2.1.3\scratch\restore.csproj : error NU1103:   - Found 0 version(s) in Microsoft Visual Studio Offline Packages
C:\Users\Chris\.templateengine\dotnetcli\v2.1.3\scratch\restore.csproj : error NU1103:   - Found 0 version(s) in C:\Program Files\dotnet\sdk\NuGetFallbackFolder
  Generating MSBuild file C:\Users\Chris\.templateengine\dotnetcli\v2.1.3\scratch\obj\restore.csproj.nuget.g.props.
  Generating MSBuild file C:\Users\Chris\.templateengine\dotnetcli\v2.1.3\scratch\obj\restore.csproj.nuget.g.targets.
  Restore failed in 196.46 ms for C:\Users\Chris\.templateengine\dotnetcli\v2.1.3\scratch\restore.csproj.

clmcgrath avatar Dec 22 '17 02:12 clmcgrath

Hmm - sorry about that; I'm at the airport right now but I'll give this a look as soon as I can.

tintoy avatar Dec 22 '17 05:12 tintoy

I'm on a very low bandwidth connection at the moment, so I can't test this myself yet, but I believe the syntax has changed slightly - you should be able to use dotnet new -i FiftyProtons.Templates.PSCore (leave off the ::*).

Would you mind giving that a try and letting me know if it works for you, @clmcgrath?

tintoy avatar Dec 22 '17 19:12 tintoy

Ah - I think I understand the issue. There are 2 problems. One is that there is no stable package (I'll publish one when I get back to civilisation) and the other is that no version was specified.

This worked for me (although it still complains about there not being a stable version):

dotnet new -i 'FiftyProtons.Templates.PSCore::0.1.0-alpha1'

tintoy avatar Dec 22 '17 19:12 tintoy

dotnet new -i FiftyProtons.Templates.PSCore didn't work for me have the same errors as before, but the dotnet new -i 'FiftyProtons.Templates.PSCore::0.1.0-alpha1' seems to be working

clmcgrath avatar Dec 22 '17 19:12 clmcgrath

Ok, thanks - I'll update the instructions in the README until I can get a stable package published.

tintoy avatar Dec 22 '17 19:12 tintoy

BTW, I've had a look at the latest version of PowerShell Core and things have moved around a little (for one thing, modules need to target netcoreapp2.0. I'll get the template updated :)

tintoy avatar Dec 22 '17 20:12 tintoy

In the meanwhile, this is the basic project file you'll need:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.PowerShell.SDK" Version="6.0.0-rc.2"/>
  </ItemGroup>
</Project>

tintoy avatar Dec 22 '17 20:12 tintoy

ya i noticed that you were still targetting 1.6 after i generated a project from the template

clmcgrath avatar Dec 22 '17 20:12 clmcgrath

Just tried updated template with PSCore RC2 and everything seems to work, so will publish a new package as soon as I have decent bandwidth.

tintoy avatar Dec 22 '17 20:12 tintoy

Sorry for the delay, @clmcgrath - I completely forgot about this while I was travelling! Have published v0.2.2 (package should show up on NuGet in 20 mins or so) and I believe the issue will then be resolved :)

tintoy avatar Apr 22 '18 02:04 tintoy