Thank you for your time. I will do my best to explain my situation.
• Visual Studio 2022 17.7.5 (Community Edition)
• C# .NET 4.8 (Also tried 4.8.1)
We have an API from VisualCron I have always used in the past.
Here is the line of code:
VisualCronAPI.Server s = new VisualCronAPI.Server();
If I attempted to Run/Debug my code with this line included I get the following error and the program will not run.
[img=https://eightbitpizzallccom-my.sharepoint.com/:i:/g/personal/chindall_eightbitpizza_com/EZIBvLm7WopCqJI1XsbWYvgBm1r7abEBal036ZBAvEY93w?e=i41IFe]Error Message[/img]
Here is the Error Output Windows Messages:
'VisualCronTest.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'.
'VisualCronTest.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\OD4B\OneDrive - Zotec Partners, LLC\Documents\Visual Studio Projects_Testing\VisualCronTest\VisualCronTest\bin\Debug\VisualCronTest.exe'. Symbols loaded.
'VisualCronTest.exe' (CLR v4.0.30319: VisualCronTest.exe): Loaded 'C:\OD4B\OneDrive - Zotec Partners, LLC\Documents\Visual Studio Projects_Testing\VisualCronTest\VisualCronTest\bin\Debug\VisualCronAPI.dll'. Symbols loaded.
'VisualCronTest.exe' (CLR v4.0.30319: VisualCronTest.exe): Loaded 'C:\OD4B\OneDrive - Zotec Partners, LLC\Documents\Visual Studio Projects_Testing\VisualCronTest\VisualCronTest\bin\Debug\VisualCron.dll'.
Exception thrown: 'System.Exception' in VisualCronAPI.dll
An unhandled exception of type 'System.TypeInitializationException' occurred in Unknown Module.
The type initializer for '<Module>' threw an exception.
A couple things I tried:
1. If I changed the code to VisualCronAPI.Server s = null; then the program rubs in debug mode no issues.
2. If I just run the compiled .exe then it works without issue.
The error has me believe that type is wrong. But if that was the case the .exe should not be able to run. I feel like there is a setting in Visual Studio that would help me bypass this error and continue debugging.
I did not have this problem with older .dlls. Any assistance would be greatly appreciated.