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.

`Project cannot be packaged` warning even when `<IsPackable>true</IsPackable>` in project file has defined

See original GitHub issue

Steps to reproduce

I have a netcoreapp2.2 project which i’m trying to build by using dotnet (3.0.100) getting the warning for warning : This project cannot be packaged because packaging has been disabled. Add <IsPackable>true</IsPackable> to the project file to enable producing a package from this project.

Expected behavior

Ignore projects which has defined <IsPackable>true</IsPackable>.

Actual behavior

Now cli prints out a warning which should not.

Environment data

dotnet --info output: .NET Core SDK (reflecting any global.json): Version: 3.0.100 Commit: 04339c3a26

Runtime Environment: OS Name: ubuntu OS Version: 18.04 OS Platform: Linux RID: ubuntu.18.04-x64 Base Path: /usr/share/dotnet/sdk/3.0.100/

Host (useful for support): Version: 3.0.0 Commit: 95a0a61858

.NET Core SDKs installed: 2.1.105 [/usr/share/dotnet/sdk] 2.1.503 [/usr/share/dotnet/sdk] 2.2.103 [/usr/share/dotnet/sdk] 3.0.100 [/usr/share/dotnet/sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.7 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.7 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.0.7 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.7 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
ivanparvareshcommented, Oct 17, 2019

The problem was i was using global project properties which was applying to all projects:

<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

By adding a condition it fixed:

<PropertyGroup Condition="$(IsPackable) == True">
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
1reaction
ivanparvareshcommented, Sep 24, 2019

@dasMulli no dotnet pack. the problem is in dotnet build command. when i’m trying to build the solution which contains multiple projects, some of them has <IsPackagable>true</IsPackagable> some of them not or have <IsPackagable>false</IsPackagable> tags. but for those project which the target framework is netcoreapp2.2 fails ( if the the tag has set to false ) .

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - .NET Core - Nuget Pack of UniTest Project shows ...
So, I believe the reason you're getting this warning is because you're packing a project type that is not intended to be packable....
Read more >
Solution Explorer Dependencies Shows Warning Icon ...
I'm upvoting this and opening my own report. The only way to get rid of these warnings is to convert from SDK style...
Read more >
PackageReference to Microsoft.AspNetCore.App is not ...
NETSDK1080 warns you that the PackageReference element for Microsoft.AspNetCore.App in your project file is not necessary.
Read more >
Old csproj to new csproj: Visual Studio 2017 upgrade guide
I've successfully converted some projects, but now the TFVC icons are missing from those projects and the files inside. Pending changes are ...
Read more >
Solution to Visual Studio 2022 messing up ...
The error shown when attempting to load the projects was: The project file cannot be opened. Unable to locate the .NET SDK. Check...
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