Вызов функции из метода приводит к сбою моего приложения (из-за «ExecutionEngineException в неизвестном модуле»)?C#

Место общения программистов C#
Ответить
Anonymous
 Вызов функции из метода приводит к сбою моего приложения (из-за «ExecutionEngineException в неизвестном модуле»)?

Сообщение Anonymous »


I had something happen today that I had never experienced before.

By way of background, I had simply moved a fairly small block of code out of a method and put the code in a function the method could call. As soon as I ran the app, I'd reach the nethod without a problem (as usual). But when it came time for the method to call the function - the moment the processing entered the function... the entire app would crash!

For what it’s worth, at least one of the times I reached the function, this error was triggered:

An unhandled exception of type 'System.ExecutionEngineException' occurred in Unknown Module

That message was new to me, but research seems to indicate that it's a fairly difficult error to try to track down because (if I understand this correctly) the error may have nothing to do with the point in the processing where the error is triggered. (Please correct me if I'm wrong about that.)

As soon as I removed the code from the function and simply placed it back into the method, everything was fine; no more error.

If it helps for you to know this, I'm using Visual Studio 2022 and .NET 8 for this project.

What could be the issue here?


Источник: https://stackoverflow.com/questions/779 ... neexceptio
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C#»