xsharp.eu • Error XS1558 ('IMap.Exe.Functions' does not have a suitable static Main method) - Page 3
Page 3 of 3

Error XS1558 ('IMap.Exe.Functions' does not have a suitable static Main method)

Posted: Tue Apr 23, 2019 2:20 pm
by George
So, let's follow the code:

1. Start()
// IMap.Exe.Functions
using System
using System.Windows.Forms

[STAThread];
public static method Start(asCmdLine as string[] ) as void
try
global::_003CModule_003E._0024AppInit()
action := { =>
Application.EnableVisualStyles()
try
DoRealStart(asCmdLine)

catch ex as Exception
MessageBox.Show(ex:Message)
end try
}
action()

finally
global::_003CModule_003E._0024AppExit()
GC.Collect()
GC.WaitForPendingFinalizers()
end try


2. Click on: global::_003CModule_003E._0024AppInit()
// <Module>
using IMap.Exe
using Softway_Common
using System
using System.Runtime.CompilerServices
using Vulcan.Runtime
using VulcanRTFuncs

[CompilerGenerated];
internal static method _0024AppInit() as void
try
State.AppModule := typeof(IMap.Exe.Functions):Module
State.CompilerOptionFOvf := false
State.CompilerOptionOvf := false
State.CompilerOptionVO11 := false
Softway_Common.Functions._0024Init1()
VulcanRTFuncs.Functions._0024Init1()
IMap.Exe.Functions._0024Init1()

catch innerException as Exception
throw Exception{"Error when executing code in Vulcan INIT procedure(s)", innerException}
end try


3. Softway_Common.Functions._0024Init1():
// Softway_Common.Functions
using System.Runtime.CompilerServices

[CompilerGenerated];
public static method _0024Init1() as void


4. VulcanRTFuncs.Functions._0024Init1():
// VulcanRTFuncs.Functions
public static method _0024Init1() as void
InitSettings()


5. IMap.Exe.Functions._0024Init1():
// IMap.Exe.Functions
using System.Runtime.CompilerServices

[CompilerGenerated];
internal static method _0024Init1() as void


I think all calls of:
global::_003CModule_003E._0024AppInit()
are here. I cannot see something of my code.

George

Error XS1558 ('IMap.Exe.Functions' does not have a suitable static Main method)

Posted: Tue Apr 23, 2019 3:33 pm
by Jamal
George,

You should never call UseCompatibleTextRendering method if your Windows Forms code is hosted in another application, such as Internet Explorer or a Class Library such as a DLL. Only call this method in stand-alone Windows Forms applications.

Error XS1558 ('IMap.Exe.Functions' does not have a suitable static Main method)

Posted: Tue Apr 23, 2019 5:26 pm
by George
Jamal,

thanks for the info.

This application is a stand-alone WinForms App, but as I found in google and Chris said, the SetCompatibleTextRenderingDefault() is not required for .NET newer than 1.1 (we are using 4.5.2 or greater).

regards
George