I am trying to debug a program I created in Visual Studio when I receive the error:
System.TypeInitializationException HResult=0x80131534 Message=The type initializer for '' threw an exception.
Source=MaterialFileManagerSQLNet StackTrace: at MaterialFileManagerSQLNet.frmMaterialManager.getAPILookupMaterial() in D:\Ctes Utilities\MaterialFileManagerSQLNet\MaterialFileManagerSQLNet\frmMaterialManager.cs:line 397 at MaterialFileManagerSQLNet.frmMaterialManager.populateDatagrid(String item) in D:\Ctes Utilities\MaterialFileManagerSQLNet\MaterialFileManagerSQLNet\frmMaterialManager.cs:line 347 at MaterialFileManagerSQLNet.frmMaterialManager..ctor() in D:\Ctes Utilities\MaterialFileManagerSQLNet\MaterialFileManagerSQLNet\frmMaterialManager.cs:line 39 at MaterialFileManagerSQLNet.Program.Main() in D:\Ctes Utilities\MaterialFileManagerSQLNet\MaterialFileManagerSQLNet\Program.cs:line 17This exception was originally thrown at this call stack: A.SBO.RG() .()
Inner Exception 1: Exception: Debugger was found - this software cannot be executed under the Debugger.
This is a C# WinForms program. It is adding and updating data to a sql server database hosted in a cloud. it breaks here:
lsLookupMaterial = getAPILookupMaterial();
and resolves here:
private List<LookupMaterial> getAPILookupMaterial()
{
mGlobalSettings.saveSettings();
List<LookupMaterial> lsLookupMaterial = new List<LookupMaterial>();
if (mGlobalSettings.Server == E_Server.Local)....
I cannot even step into the function without the error occurring.
Has anyone encountered this? This feels like a project setting somewhere but I am unsure. I am already running under admin.
Turns out we have our own obfuscated code I was trying to step through. Got the latest signed code and all was well.
User contributions licensed under CC BY-SA 3.0