dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.7k stars 1.06k forks source link

dotnet publish won't publish/build #25965

Closed siblount closed 2 years ago

siblount commented 2 years ago

Describe the bug

dotnet publish will say that the build and publish have succeeded, however, no files are outputted whatsoever. Same goes for the Publish Section in Visual Studio Community as well. Fortunately, doing a normal dotnet build and building the solution and/or project from Visual Studio does work. THIS DOES NOT AFFECT MY OTHER PROJECTS; IT ONLY OCCURS ON THIS PROJECT.

To Reproduce

1) Clone repo from https://github.com/siblount/DazProductInstaller.git 2) dotnet publish src\Daz_Installer.csproj -o ext_dir 3) Realize that no files or directories have been created but publish and build succeeds.

Or via Visual Studio 1) Clone repo from https://github.com/siblount/DazProductInstaller.git 2) Build -> Publish Selection 3) Publish to folder, choose folder location, hit finish. 4) Change configuration to Release | x64 and target runtime to win-x64 5) Hit publish. 6) Notice that no files or directories have been created at the target location.

Possible helpful info

Don't hurt me if it's not helpful D: There was a lot of MSBuild task skipped event logged when I ran the publish command with verbose of detailed. See publish_log.txt publish_log.txt

Further technical details

dotnet-info:

.NET SDK (reflecting any global.json):
 Version:   6.0.201
 Commit:    ef40e6aa06

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19044
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.201\

Host (useful for support):
  Version: 6.0.3
  Commit:  c24d9a9c91

.NET SDKs installed:
  2.1.801 [C:\Program Files\dotnet\sdk]
  5.0.201 [C:\Program Files\dotnet\sdk]
  6.0.201 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Visual Studio Community 2022 17.1.3

vijayrkn commented 2 years ago

The issue is that the project is marked as Not Publishable: https://github.com/siblount/DazProductInstaller/blob/main/src/DAZ_Installer.csproj#L8

If you set the project as publishable, then it should work.