I'm attempting to run a WinExe with <UseWPF>true</UseWPF>
, but it is not even running a simple Hello World program. I'm not sure what's wrong at this point, the only clue is this inner exception.
An unhandled exception of type 'System.BadImageFormatException' occurred in CSharpProgram.dll: 'Could not load file or assembly 'PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Reference assemblies cannot be loaded for execution. (0x80131058)'
Here is my .csproj file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
</PropertyGroup>
</Project>
Here is the program:
using System;
public class Program
{
public static void Main() {
Console.WriteLine("Hello World!");
}
}
Any help is greatly appreciated.