FileNotFoundException on every startup of a .NET app

When I create a .NET application project in Water (using Swift, since I only have the free license), every time I run it, it crashes immediately with a FileNotFoundException. The crash is so early the debugger isn’t even initialized; there’s no stack trace. Letting the program complete the crashing process reveals that the .NET runtime cannot find System.Runtime.dll. This happens for both .NET Core and .NET Framework (classic). This happens with both the .NET Core and classic .NET project types, and with any type of .NET application AFAICT (I have tried both command-line and WPF applications).

There is literally nothing else I can do other than report it here as a bug. Note that this does not occur when using Fire on macOS, although trying to develop for WPF with that has created a different issue, which I will file separately.

I am on build 2575.

William,

curious; that is not something we can reproduce here tor have ever hard of (and suffice to say we build and run .NET projects all day every day ;). This happens with a project crested straight from, say the “Console app” template and without any changes, and whether you use the “Classic .NET” or “.NET Core” template? (bot get executed very different;y, so its rather odd they’d show the same symptoms; System.Runtime.dll afaik is a .NET Core specific thing and doesn’t even exist for Classic .NET).

What versions of .NET and .NET Core do you have installed? Is there any chance I can TeamView onto your computer and (with your supervision) see this happen in action to get a better look?

Also, I’ve uploaded today’s build 2585 to your Personal Downloads folder — does the issue persist with that version, for you?

thanx,
marc

Updated to 2585; did no good. I have found a second, different type of exception being thrown, as shown in the screenshot below. This happens four or five times before the process terminates; it then complains of a missing System.Windows.Forms.dll. Seeing as I got a BadImageFormatException, I tried changing the PDB build setting to Portable from Classic; did no good also. This issue occurs with the target framework build setting set to both “.NET5.0” and .NET Framework 4.8. I am open to a TeamViewer session; please DM me to set it up. Thanks!


.NET Core versions (dotnet --info):

.NET SDK (reflecting any global.json):
 Version:   5.0.200-preview.20601.7
 Commit:    b3b934bbf2

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.21277
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\

Host (useful for support):
  Version: 5.0.1
  Commit:  b02e13abab

.NET SDKs installed:
  3.0.100 [C:\Program Files\dotnet\sdk]
  5.0.200-preview.20601.7 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

I also have .NET Framework 4.8 installed.

Very strange. I was out of office all day today, but I’ll follow up to narrow this down tomorrow. Any chance we can plan for me to remotely connect to your computer tomorrow to have a look, via TeamViewer?

I am available for a TeamViewer appointment tomorrow at 3:00 PM EST, if that works for you.

William,

that should work for me, I’m on AST, so one hour ahead of you, making this 4PM my time. Send me a PM with your details when the time comes…

thanx!

Update for posterity: it turns out you cannot just take a .NET Core app thats not set to run on the WindowsDesktop version of the .NET Core runtime, add Microsoft.WindowsDektop.App(.Ref) as package reference.

I’ll review if I can detect this mismatch in the build chain to avoid confusion like that in the future, but to does’t look likely — the packages doesnt come with much (or any) useful metadata :(.

[.NET Classic and .NET Core apps that either didn’t use the package or were set to run on WindowsDesktop were running fine].