Vulcan.NET: System.InvalidProgramException

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Kromi
Posts: 45
Joined: Wed Jan 13, 2016 8:31 am

Vulcan.NET: System.InvalidProgramException

Post by Kromi »

Hi,

I have a pretty severe problem with our Vulcan code. If I build the code on my machine and start the resulting executable, I get the attached error message and then the process is terminated. I'm pretty sure it's not the code; the same code built on another machine runs on my machine. The code built on my machine does not run on other machines.

The German text in the error message translates to something like "The Common Language Runtime has found an invalid program."

I have no idea what caused this problem, whether it was a Windows update or a Visual Studio update or anything else.

Any ideas what I can do?

Regards,
Mathias
Attachments
InvalidProgramException.PNG
InvalidProgramException.PNG (14.78 KiB) Viewed 736 times
User avatar
Chris
Posts: 4913
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Vulcan.NET: System.InvalidProgramException

Post by Chris »

Mathias,

Are you compiling it with the vulcan or the X# compiler? Are you using the exact same project files? Maybe there are some differences in compiler options..

Also are there any important differences between the two PCs, different OS or different .Net framework version?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Kromi
Posts: 45
Joined: Wed Jan 13, 2016 8:31 am

Vulcan.NET: System.InvalidProgramException

Post by Kromi »

I'm compiling with the Vulcan compiler. Project and code files are identical, so are the compiler options - as far as I can tell.

I think it's a problem in my windows environment, but do you have an idea where it's worth to look at? Installed .NET Frameworks seem to be the same, but I'll double check that. Any other idea?
User avatar
lumberjack
Posts: 727
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Vulcan.NET: System.InvalidProgramException

Post by lumberjack »

Hi Matthias,
Kromi wrote:I'm compiling with the Vulcan compiler. Project and code files are identical, so are the compiler options - as far as I can tell.
A shot in the dark, but it seems to appear around the SplashScreen that you are showing. Does that maybe give a hint or an idea what might cause the problem? What happens if you omit the SplashScreen display from your code?
______________________
Johan Nel
Boshof, South Africa
User avatar
Chris
Posts: 4913
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Vulcan.NET: System.InvalidProgramException

Post by Chris »

I think it's best to compare the working and not-working exes to see what's their difference. Try using ILSpy (https://github.com/icsharpcode/ILSpy/re ... tag/v4.0.1) or any other .Net disasm tool, dump their contents in text files and compare them.

With ILSpy, you need to load the .exe, select from the menu File->Save Code, then unload the .exe, load the other version and export again. Compare the two files with a file comparer, do you see major or minor differences?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Kromi
Posts: 45
Joined: Wed Jan 13, 2016 8:31 am

Vulcan.NET: System.InvalidProgramException

Post by Kromi »

It's not a splash screen, but I will eventually try commenting out some code.
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Vulcan.NET: System.InvalidProgramException

Post by wriedmann »

Hi Matthias,

try install all pending Windows Updates. Sometimes pending or half installed Windows Updates can give very strange errors.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Kromi
Posts: 45
Joined: Wed Jan 13, 2016 8:31 am

Vulcan.NET: System.InvalidProgramException

Post by Kromi »

Thank you Wolfgang, no pending updates here. To get rid of this error I not only have installed all updates Microsoft has to offer, I also have re-installed Windows and have the same error again.
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Vulcan.NET: System.InvalidProgramException

Post by wriedmann »

Hi Matthias,
do you really have reinstalled Windows completely from scratch or do you have only made a reinstallation?
You problem seems to be a .NET Framework corruption.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Kromi
Posts: 45
Joined: Wed Jan 13, 2016 8:31 am

Vulcan.NET: System.InvalidProgramException

Post by Kromi »

Wolfgang, I have erased all partitions from the SSD and installed from scratch.

Following Chris' advise I have compared the ILSpy output from a functioning version with the not functioning one. I found a difference in the constructor that is also listed in the error message. The not functioning code looks like this. The characters in red are not present in the functioning code.
[ClipperCallingConvention(new string[]
{

})]
public unsafe GapProcessInfo(params __Usual[] _0024args)
{
//Error decoding local variables: Signature type sequence must have at least one element.
Monitor.Enter(lockTaken: ref *(bool*)VnLibGUITool.Functions._0024_0024StaticLocal_InitFlag__0024iSOFT_002ELSC_002EKernel_002EGapProcessInfo_0024_002Ector_0024_003A558_003A15_0024lIsNewProc, obj: (object)/*Error near IL_00b1: Stack underflow*/);
try
{
...
}
finally
{
StaticLocalInitFlag ...
}
base._002Ector();
nIsDevelopment = (short)(-1);
getInfo();
oMemInfo = null;
}

I have removed some of the code that made it more unreadable and not used the code tag to be able to mark characters red.
Post Reply