C
C#9mo ago
!Rushaan

Trying to publish WPF App but getting error

C:\Program Files\dotnet\sdk\5.0.411\Microsoft.Common.CurrentVersion.targets(3162,5): error MSB4216: Could not run the "GenerateResource" task because MSBuild could not create or connect to a task host with runtime "CLR4" 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\5.0.411\MSBuild.exe" exists and can be run. [C:\Users\rusha\source\repos\WeatherApp\WeatherApp\WeatherApp.csproj]
C:\Program Files\dotnet\sdk\5.0.411\Microsoft.Common.CurrentVersion.targets(3184,7): error MSB4028: The "GenerateResource" task's outputs could not be retrieved from the "FilesWritten" parameter. Object does not match target type.
C:\Program Files\dotnet\sdk\5.0.411\Microsoft.Common.CurrentVersion.targets(3162,5): error MSB4216: Could not run the "GenerateResource" task because MSBuild could not create or connect to a task host with runtime "CLR4" 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\5.0.411\MSBuild.exe" exists and can be run. [C:\Users\rusha\source\repos\WeatherApp\WeatherApp\WeatherApp.csproj]
C:\Program Files\dotnet\sdk\5.0.411\Microsoft.Common.CurrentVersion.targets(3184,7): error MSB4028: The "GenerateResource" task's outputs could not be retrieved from the "FilesWritten" parameter. Object does not match target type.
I'm trying to publish a WPF C# application so that I get it's .exe but I keep getting that error. The command I ran was dotnet publish -c Release MSBuild.exe was not present in the folder give in error so from somewhere of Visual Studio folder I found MSBuild.exe and copy pasted it in that folder and still getting the exact same error.
20 Replies
jcotton42
jcotton429mo ago
can you show the csproj for the app? @Azym Equinox
!Rushaan
!Rushaan9mo ago
1 min
jcotton42
jcotton429mo ago
I mean the actual text of the csproj
!Rushaan
!Rushaan9mo ago
oh how exactly do i open the csproj to see its text
jcotton42
jcotton429mo ago
though, based on packages.config that looks suspiciously like a Framework project should be an option in the right click, or just open it in something like notepad
!Rushaan
!Rushaan9mo ago
yes its a .NET Framework 4.7.2 project k
jcotton42
jcotton429mo ago
yeah that's why dotnet doesn't really work well with Framework projects use msbuild from the VS Command Prompt, or publish from Visual Studio
!Rushaan
!Rushaan9mo ago
oh
jcotton42
jcotton429mo ago
yep, typical Framework csproj a giant mess
!Rushaan
!Rushaan9mo ago
i tried publishing from visual studio but i just cant find the right options, all i want is an executable file but it gives options like cd/dvd, file share etc
jcotton42
jcotton429mo ago
isn't there a folder option?
!Rushaan
!Rushaan9mo ago
i dont think so
jcotton42
jcotton429mo ago
show a screenshot
!Rushaan
!Rushaan9mo ago
jcotton42
jcotton429mo ago
oh, huh try the CD option? might just put files somewhere
Want results from more Discord servers?
Add your server