Why does attempting to start a task cause an EntryPointNotFoundException?
Asked Answered
A

0

7

In my application, I have a utility class which is supposed to execute a series of tasks in parallel, and provide reporting on the success and timing of the various tasks.

Every time I run it, I get an EntryPointNotFoundException.

The simplest test case I could come up with which creates the behavior is beyond trivial. Just

 Task.Run(() => { Console.WriteLine("This is sanity test"); });

using no return value, and no custom classes anywhere throws an EntryPointNotFoundException.

VS2015 image showing code and exception

This is with Visual Studio 2015, the process is 64 bit (which for the overall application it MUST be, running on Windows 7 64-bit). It is a .NET 4.5 console application.

What causes this and how can it be fixed?

Atalya answered 15/9, 2015 at 20:0 Comment(8)
Is this an ASP.NET Console application by any chance?Sought
No, its a plain console. It happens to be a web server in its own right, but not ASP.NET, and not using IIS. It uses the old free version of ServiceStack in standalone mode but that didn't seem relevant to the Task throwing exception issue.Atalya
I'm asking because you marked this with .net-core for one. And, this issue happens on CoreCLR, which is the xplat implementation of the run-time. As @Dave said in his answer, there is also a known bug open to the OS team. Is this a new console app or has this been running fine on previous VS versions?Sought
@YuvalItzchakov I did not mark it .net-core. A passing editor did, not quite sure why.Atalya
It is a very old console app which has run well in assorted previous versions through at least three Visual Studio versions and several .NETs--but this particular parallelism code is brand new. I don't know if the old parallelism code which was more deeply coupled still works because I haven't gotten that far in the new refactoring--and this module was supposed to replace it anyway.Atalya
Isn't this the same problem - github.com/dotnet/coreclr/issues/974 ?Drees
@Drees Yes, it is. SAJ - Try pressing F5 to continue. Do you have first chance exceptions enabled?Sought
Clicking continue did in fact allow the code to execute correctly--but what a colossal waste of time and effort that bug caused. I don't know if I have first chance exceptions enabled, I haven't found the appropriate setting in VS15 yet... the Debug | Window | Exception Settings thingy either doesn't contain it or has it hidden away somewhere obscure I am not seeing it.Atalya

© 2022 - 2024 — McMap. All rights reserved.