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

Preview2 packages missing? #9162

Closed
ghost opened this issue Mar 11, 2018 · 8 comments
Closed

Preview2 packages missing? #9162

ghost opened this issue Mar 11, 2018 · 8 comments

Comments

@ghost
Copy link

ghost commented Mar 11, 2018

In Alpine 3.7, i tried 3.6 tarball:

docker run -it alpine:latest
apk update
apk add curl libstdc++ libunwind libintl icu openssl

curl -O https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-alpine.3.6-x64.tar.gz
mkdir -p /usr/bin/dotnet
tar -xzvf dotnet-sdk-latest-alpine.3.6-x64.tar.gz  -C /usr/bin/dotnet
export PATH=$PATH:/usr/bin/dotnet
rm dotnet-sdk-latest-alpine.3.6-x64.tar.gz

After that when i run dotnet new console -n testconsole, i get

Processing post-creation actions...
Running 'dotnet restore' on testconsole/testconsole.csproj...
  Restoring packages for /testconsole/testconsole.csproj...
/testconsole/testconsole.csproj : error NU1102: Unable to find package Microsoft.NETCore.App with version (>= 2.1.0-preview2-26309-01)
/testconsole/testconsole.csproj : error NU1102:   - Found 24 version(s) in nuget.org [ Nearest version: 2.1.0-preview1-26216-03 ]
  Generating MSBuild file /testconsole/obj/testconsole.csproj.nuget.g.props.
  Generating MSBuild file /testconsole/obj/testconsole.csproj.nuget.g.targets.
  Restore failed in 206.09 ms for /testconsole/testconsole.csproj.

Restore failed.
Post action failed.
Description: Restore NuGet packages required by this project.
Manual instructions: Run 'dotnet restore'

Unable to find package Microsoft.NETCore.App with version (>= 2.1.0-preview2-26309-01)
Nearest version: 2.1.0-preview1-26216-03

@ghost
Copy link

ghost commented Mar 11, 2018

According to readme, preview2 is the latest and i took the tarball link from there:

image

cc @Petermarcu

@Petermarcu
Copy link
Member

My guess is that its trying to resolve the packages from Nuget.org. In order to resolve packages that are part of the dev feeds, you need to make sure you have the dotnet-core myget feed in a nuget.config: https://dotnet.myget.org/F/dotnet-core/api/v3/index.json

@Petermarcu
Copy link
Member

@ghost
Copy link

ghost commented Mar 12, 2018

Could that entry go in global NuGet.config, as part of the latest tarballs?

@Petermarcu
Copy link
Member

We had done that in the past and could consider again. @livarcocc thoughts? I recall we had some challenges with making sure that nuget.config never got into a release build and it was just safer to keep them the same. @kasper3 you could open an issue specifically about that if you'd like.

@livarcocc
Copy link
Contributor

The CLI does not modify the global NuGet.Config file. In the past, we had dotnet new drop a NuGet.Config file when projects were created, but that ended up leading to confusion, so we took it out.

We have an issue to update our nightly build instructions to include the step to add necessary feeds. I would like to go with that before trying anything else.

We will use https://github.com/dotnet/cli/issues/8291 to track improving those instructions.

@ghost
Copy link

ghost commented Mar 12, 2018

The current user experience is that dotnet new fails in first attempt on new OS. The only way to avoid it is to create ~/.nuget/NuGet/NuGet.Config file with following content before running dotnet new

<?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="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
  </packageSources>
</configuration>

@livarcocc
Copy link
Contributor

Yes, for a nightly build I believe it is fine to require a NuGet.Config.

Also note that the NuGet.Config does not need to be in the directory above, you can place it right next tot he project you just created, which is what we used to do.

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
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