C
C#6mo ago
Haxo

Publish fails with --self-contained/--sc switch

What I'm doing wrong?
No description
28 Replies
kailash T.
kailash T.6mo ago
Install .net core
Haxo
Haxo6mo ago
it is installed
No description
ZacharyPatten
ZacharyPatten6mo ago
please share dotnet --info also, I assume this is from VSC? if you use VS you will have an easier time
Haxo
Haxo6mo ago
.NET SDK:
Version: 8.0.100
Commit: 57efcf1350
Workload version: 8.0.100-manifests.6a1e483a

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22621
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.100\

.NET workloads installed:
Workload version: 8.0.100-manifests.6a1e483a
There are no installed workloads to display.

Host:
Version: 8.0.0
Architecture: x64
Commit: 5535e31a71

.NET SDKs installed:
6.0.417 [C:\Program Files\dotnet\sdk]
7.0.401 [C:\Program Files\dotnet\sdk]
8.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set
.NET SDK:
Version: 8.0.100
Commit: 57efcf1350
Workload version: 8.0.100-manifests.6a1e483a

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22621
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.100\

.NET workloads installed:
Workload version: 8.0.100-manifests.6a1e483a
There are no installed workloads to display.

Host:
Version: 8.0.0
Architecture: x64
Commit: 5535e31a71

.NET SDKs installed:
6.0.417 [C:\Program Files\dotnet\sdk]
7.0.401 [C:\Program Files\dotnet\sdk]
8.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set
global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download
global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download
yes
ZacharyPatten
ZacharyPatten6mo ago
can you share your .csproj?
Haxo
Haxo6mo ago
should I just copy paste the content of file here so you don't have to download it?
ZacharyPatten
ZacharyPatten6mo ago
have you restarted VSC since you installed .NET 8?
Haxo
Haxo6mo ago
um... I used that command outside IDE (in cmd) should I do it inside IDE?
ZacharyPatten
ZacharyPatten6mo ago
no. what I'm asking is have you had VSC running since before you installed .NET 8? because if you have not closed VSC since you did that install, it may just need to be restarted (try restarting VSC)
Haxo
Haxo6mo ago
nope. I had VSC closed while installing
ZacharyPatten
ZacharyPatten6mo ago
well crap. I'm not seeing the issue then. is the code open source? if yes link it please. if not, because I don't see the issue yet.... my best advice would be to install VS
Haxo
Haxo6mo ago
it is only on my computer. I'm sure there's no issue with code cuz it works when I don't use --sc switch but if you wish i can send code here
Haxo
Haxo6mo ago
Haxo
Haxo6mo ago
i might be wrong idk
ZacharyPatten
ZacharyPatten6mo ago
I was able to run the command on my end and it worked even with --sc. sorry I don't see the issue yet. Hopefully someone else will spot the issue or have advice. As mentioned, if you install VS that will probably fix your issue.
Haxo
Haxo6mo ago
ok I will try to build it on vs. Thanks for trying. have nice day
ZacharyPatten
ZacharyPatten6mo ago
good luck
Haxo
Haxo6mo ago
the same error in vs
No description
ZacharyPatten
ZacharyPatten6mo ago
did you install the .NET desktop develpoment workload?
ZacharyPatten
ZacharyPatten6mo ago
No description
ZacharyPatten
ZacharyPatten6mo ago
when you installed VS? you can add it by launching the Visual Studio Installer and clicking "modify" on your installed version of VS
Haxo
Haxo6mo ago
No description
ZacharyPatten
ZacharyPatten6mo ago
and still error? dang... not sure. sorry. hopefully someone else will chime in
Haxo
Haxo6mo ago
maybe it about these
No description
SinFluxx
SinFluxx6mo ago
Have you checked the possible solutions for that error code? https://learn.microsoft.com/en-gb/nuget/reference/errors-and-warnings/nu1100
NuGet Error NU1100
NU1100 error code
Haxo
Haxo6mo ago
I solved the problem nvm. I just touched something that I didn't understood and that was the issue