C
C#4mo ago
nebula

✅ trying to build a single file WPF app but the publish dialog box looks nothing like the docs

As seen here: https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=vs My publish doesn't look like this. I'm not sure what I'm doing wrong? (my publish dialog is the second image)
Create a single file for application deployment - .NET
Learn what single file application is and why you should consider using this application deployment model.
No description
No description
No description
12 Replies
nebula
nebula4mo ago
I tried CLI too: dotnet publish -r win-x64 and got this:
Determining projects to restore...
Nothing to do. None of the projects specified contain packages to restore.
C:\Program Files\dotnet\sdk\8.0.303\Microsoft.Common.CurrentVersion.targets(3398,5): error MSB4216: Could not run the "GenerateResource" task because MSBuild could not create or connect to a task host with runtime "NET" and architecture "x86". Please ensure that (1) the requested
runtime and/or architecture are available on the machine, and (2) that the required executable "C:\Program Files\dotnet\sdk\8.0.303\MSBuild.dll" exists and can be run. [C:\Users\...\source\repos\mileage-calculator\mileage-calculator\mileage-calculator.csproj]
C:\Program Files\dotnet\sdk\8.0.303\Microsoft.Common.CurrentVersion.targets(3422,7): error MSB4028: The "GenerateResource" task's outputs could not be retrieved from the "FilesWritten" parameter. Object does not match target type. [C:\Users\...\source\repos\mileage-calculator\mileag
e-calculator\mileage-calculator.csproj]
Determining projects to restore...
Nothing to do. None of the projects specified contain packages to restore.
C:\Program Files\dotnet\sdk\8.0.303\Microsoft.Common.CurrentVersion.targets(3398,5): error MSB4216: Could not run the "GenerateResource" task because MSBuild could not create or connect to a task host with runtime "NET" and architecture "x86". Please ensure that (1) the requested
runtime and/or architecture are available on the machine, and (2) that the required executable "C:\Program Files\dotnet\sdk\8.0.303\MSBuild.dll" exists and can be run. [C:\Users\...\source\repos\mileage-calculator\mileage-calculator\mileage-calculator.csproj]
C:\Program Files\dotnet\sdk\8.0.303\Microsoft.Common.CurrentVersion.targets(3422,7): error MSB4028: The "GenerateResource" task's outputs could not be retrieved from the "FilesWritten" parameter. Object does not match target type. [C:\Users\...\source\repos\mileage-calculator\mileag
e-calculator\mileage-calculator.csproj]
Seems like it wants a specific sdk installed? I'm still quite new and not sure what it wants exactly
Angius
Angius4mo ago
Not sure if Core 3.1 had full support for single file builds
nebula
nebula4mo ago
Is it possible to change that so I can make a single file?
Angius
Angius4mo ago
Sure, updating to a moden version of .NET is always possible How easy it is will vary, but in case of 3.1 it should be fairly painless Just change the framework version in the project properties to 8.0
nebula
nebula4mo ago
I think my work PCs target 6- I assume it's the same process?
Angius
Angius4mo ago
Yeah
nebula
nebula4mo ago
I had to use upgrade assistant to upgrade. So now I'm on 6.0 which is great but I am getting a build error:
MSB4094 "publish\Application Files\mileage-calculator_1_0_0_0\mileage-calculator.exe.manifest;publish\Application Files\mileage-calculator_1_0_0_1\mileage-calculator.exe.manifest" is an invalid value for the "InputManifest" parameter of the "GenerateApplicationManifest" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem". mileage-calculator C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 4269
MSB4094 "publish\Application Files\mileage-calculator_1_0_0_0\mileage-calculator.exe.manifest;publish\Application Files\mileage-calculator_1_0_0_1\mileage-calculator.exe.manifest" is an invalid value for the "InputManifest" parameter of the "GenerateApplicationManifest" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem". mileage-calculator C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 4269
nebula
nebula4mo ago
Double clicking on the error brings me here:
No description
nebula
nebula4mo ago
But this is really just noise to me. I'm not sure what any of it means I looked online and some solutions were to delete the bin and obj folders and clean/rebuild. So I did that- same error upon building I deleted my publish folder And it seemed to build.
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX4mo ago
If you have no further questions, please use /close to mark the forum thread as answered
nebula
nebula4mo ago
/close
Want results from more Discord servers?
Add your server