question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Simple console app requires ASP.NET packages

See original GitHub issue
  1. Install latest master SDK
C:\d\dotnet30>dotnet --version
3.0.100-preview6-011846
  1. 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>
  1. 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.
  1. 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:open
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
dsplaistedcommented, Aug 24, 2020

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

1reaction
jkotascommented, May 14, 2019

It will matter to customers that publish self-contained apps. They will need to download a lot more stuff than what’s required…

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found