xsharp.eu • Vulcan.NET: System.InvalidProgramException - Page 3
Page 3 of 3

Vulcan.NET: System.InvalidProgramException

Posted: Tue Aug 20, 2019 10:28 am
by robert
Mathias,
I think there are different versions of the .Net framework on both machines.
When compiling Vulcan does not load the reference assemblies from the "c:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFramework" subfolders (like C# and X# do) but loads the reference assemblies from the c:WindowsMicrosoft.NETFrameworkv4.0.30319 folder.
This has a risk: even if you tell the compiler that you want to compile against version 4.6, it will still resolve your code against the version that is installed in that folder. So you (or the compiler) may use something that is not available in the target framework that you selected.

C# and X# use the reference assemblies from one of the subfolders from the above folder, so you know for sure that you are only using things that are allowed on that particular version of the framework.

Robert

Vulcan.NET: System.InvalidProgramException

Posted: Tue Aug 20, 2019 12:21 pm
by Kromi
Robert,

you're absolutely right. On my machine there are .NET Framework 4.8 asseblies in the c:WindowsMicrosoft.NETFrameworkv4.0.30319 folder. The other machines have 4.7.
I have found no way to uninstall .NET Framework 4.8 that actually worked on my machine. So I guess I have to re-install Windows again and stick with an older version.

Anyway, thanks a lot for analysis and advice!

Mathias

Vulcan.NET: System.InvalidProgramException

Posted: Tue Aug 20, 2019 12:40 pm
by robert
Mathias,

This is exactly the reason why a compiler should compile against the reference assemblies and not against the assemblies in the Windows folder.
I think that converting your Vulcan project files to X# project files and compiling with X# (and maybe setting some compiler options or suppressing some new warnings) will be less work then reinstalling Windows, and will also give you better performance during compiling.

Robert

Vulcan.NET: System.InvalidProgramException

Posted: Tue Aug 20, 2019 2:51 pm
by Chris
Mathias,

Vulcan uses the .Net classes themselves (System.Reflection.Emit) to generate code, so I suspect that what happened is that in the latest framework version something changed in those classes, breaking vulcan code generation. Probably a bug in the update from MS I would guess.

But as Robert said, X# is extremely compatible with vulcan, so it should not take you months to start using the X# compiler instead. I would bet it will take you less than a week actually or less.