Simple console app requires ASP.NET packages
See original GitHub issue- Install latest master SDK
C:\d\dotnet30>dotnet --version
3.0.100-preview6-011846
- Create a nuget.config in this folder that only uses nuget and the dotnet feed. I also cleared my nuget cache anyway.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="dotnetcore-feed" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
</packageSources>
</configuration>
- Create a new console app (I did this in a subfolder so it’s subject to the nuget.config)
C:\d\dotnet30\2>..\dotnet.exe new console
Getting ready...
The template "Console Application" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on C:\d\dotnet30\2\2.csproj...
Restore completed in 109.59 ms for C:\d\dotnet30\2\2.csproj.
Restore succeeded.
- Publish this app
C:\d\dotnet30\2>..\dotnet.exe publish -r win-x64
Microsoft (R) Build Engine version 16.1.67-preview+g13843078ee for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
C:\d\dotnet30\2\2.csproj : error NU1102: Unable to find package Microsoft.AspNetCore.App.Runtime.win-x64 with version (= 3.0.0-preview6-19260-04)
C:\d\dotnet30\2\2.csproj : error NU1102: - Found 24 version(s) in dotnetcore-feed [ Nearest version: 3.0.0-preview4-19121-14 ]
C:\d\dotnet30\2\2.csproj : error NU1102: - Found 2 version(s) in nuget [ Nearest version: 3.0.0-preview5-19227-01 ]
Restore failed in 303.74 ms for C:\d\dotnet30\2\2.csproj.
I should not need ASP.NET nor should publishing it include the ASP.NET runtime.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Create a .NET console application using Visual Studio
Learn how to create a .NET console application with C# or Visual Basic using Visual Studio.
Read more >Build a Console App in .NET Core Like a Pro! - Espresso Coder
NET Core you can create a new console application with the .NET Core CLI or with the Visual Studio “New Project” menu item....
Read more >NET Core console app. Nuget package added, but "using" ...
I just created a basic console app with: dotnet add console. Now I open the folder in VS Code, and in the Terminal...
Read more >Using dependency injection in a .Net Core console ...
In this post, I show how to setup dependency injection in a .NET Core console app, both with the ASP.NET Core built-in container...
Read more >.NET Core Console App Set Up | Don't Panic Labs
.NET Core Console App Set Up · Step 1. Create a console application · Step 2. Add some NuGet package references · Step...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes.
We could avoid these downloads, but it would required a new feature in NuGet. We’ve discussed it before but I couldn’t find it documented anywhere, so I’ve filed this issue to capture it: https://github.com/NuGet/Home/issues/9937
It will matter to customers that publish self-contained apps. They will need to download a lot more stuff than what’s required…