Search found 106 matches

by George
Tue Apr 23, 2019 5:26 pm
Forum: Product
Topic: Error XS1558 ('IMap.Exe.Functions' does not have a suitable static Main method)
Replies: 22
Views: 7497

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

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
by George
Tue Apr 23, 2019 2:20 pm
Forum: Product
Topic: Error XS1558 ('IMap.Exe.Functions' does not have a suitable static Main method)
Replies: 22
Views: 7497

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

<t>So, let's follow the code:<br/>
<br/>
1. Start()<br/>
// IMap.Exe.Functions<br/>
using System<br/>
using System.Windows.Forms<br/>
<br/>
[STAThread];<br/>
public static method Start(asCmdLine as string[] ) as void<br/>
try<br/>
global::_003CModule_003E._0024AppInit()<br/>
action := { =><br ...
by George
Tue Apr 23, 2019 1:37 pm
Forum: Product
Topic: Error XS1558 ('IMap.Exe.Functions' does not have a suitable static Main method)
Replies: 22
Views: 7497

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

<t>Hi Chris,<br/>
<br/>
>check what else is being called before your actual first lines of code<br/>
Yes. There is something before.<br/>
<br/>
ILSpy results (before obfuscator):<br/>
<br/>
using System<br/>
using System.Windows.Forms<br/>
<br/>
[STAThread];<br/>
public static method Start(asCmdLine ...
by George
Tue Apr 23, 2019 12:41 pm
Forum: Product
Topic: Error XS1558 ('IMap.Exe.Functions' does not have a suitable static Main method)
Replies: 22
Views: 7497

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

<r>Hi,<br/>
<br/>
after some Googling, I found this:<br/>
Trouble with Windows Forms, in method SetCompatibleTextRenderingDefault:<br/>
<URL url="https://forums.autodesk.com/t5/revit-api-forum/trouble-with-windows-forms-in-method-quot/td-p/7479941"><LINK_TEXT text="https://forums.autodesk.com/t5 ...
by George
Tue Apr 23, 2019 12:11 pm
Forum: Product
Topic: Error XS1558 ('IMap.Exe.Functions' does not have a suitable static Main method)
Replies: 22
Views: 7497

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

Anyway, I kept the line into the Start():
Application.EnableVisualStyles()

and removed the line:
Application.SetCompatibleTextRenderingDefault( FALSE )

this way the application works.

thanks
George
by George
Tue Apr 23, 2019 10:31 am
Forum: Product
Topic: Error XS1558 ('IMap.Exe.Functions' does not have a suitable static Main method)
Replies: 22
Views: 7497

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

<t>Robert,<br/>
<br/>
many years ago, when started coding in .NET, these 2 code lines exists in all Start() functions.<br/>
<br/>
Also, your default generated code (X# Windows Forms Application) when a WinApp created is:<br/>
[STAThread] ;<br/>
FUNCTION Start() AS VOID<br/>
<br/>
Application ...
by George
Tue Apr 23, 2019 9:58 am
Forum: Product
Topic: Error XS1558 ('IMap.Exe.Functions' does not have a suitable static Main method)
Replies: 22
Views: 7497

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

<t>Robert,<br/>
<br/>
preparing to send you my Project, I saw that a Reference to my huge Common.DLL is not really required because I call only some (3-4) methods, so I created a small Common Class inside my project with the required Methods.<br/>
<br/>
Then, I tested and the application worked ...
by George
Tue Apr 23, 2019 7:40 am
Forum: Product
Topic: Error XS1558 ('IMap.Exe.Functions' does not have a suitable static Main method)
Replies: 22
Views: 7497

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

Hi Robert,

I will send you the project.
You will have only to download .NET Reactor 5 (as evaluation for 1 month)
or better, I will send you my .NET Reactor version to test with the same tools.

George
by George
Mon Apr 22, 2019 5:54 pm
Forum: Product
Topic: Error XS1558 ('IMap.Exe.Functions' does not have a suitable static Main method)
Replies: 22
Views: 7497

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

<t>Robert,<br/>
<br/>
I changed my WinApp's properties to Console Application.<br/>
<br/>
The error is:<br/>
Unhandled Exception: System.InvalidOperationException: SetCompatibleTextRenderingDefault must be called before the first IWin32Window object is created in the application.<br/>
at System ...
by George
Mon Apr 22, 2019 5:34 pm
Forum: Product
Topic: Error XS1558 ('IMap.Exe.Functions' does not have a suitable static Main method)
Replies: 22
Views: 7497

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

<t>Robert,<br/>
<br/>
the sample project contains only the default Start() created by X# (Vulcan Application template):<br/>
FUNCTION Start() AS VOID STRICT<br/>
LOCAL cbMacro AS CODEBLOCK<br/>
LOCAL cMacro AS STRING<br/>
cMacro := "{||DTOC(Today())}"<br/>
cbMacro := &(cMacro)<br/>
Console ...