Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

hello_auto sample: Cannot find entry point #8

Closed
megakraken opened this issue Nov 29, 2023 · 3 comments
Closed

hello_auto sample: Cannot find entry point #8

megakraken opened this issue Nov 29, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@megakraken
Copy link

megakraken commented Nov 29, 2023

Hello,

When trying to run the hello_auto.cs script with cscs /ac samples\hello_auto.cs I get the following error message:

Error: Specified file could not be executed.

System.ApplicationException: Cannot find entry point. Make sure script file contains method: 'public static Main(...)'
   at csscript.RemoteExecutor.InvokeStaticMain(Assembly compiledAssembly, String[] scriptArgs)
   at csscript.CSExecutor.ExecuteImpl()

I figured the /ac option should do the trick, what am I doing wrong?

For reference, the script looks like this:

using System;
using System.Windows.Forms;

void Main()
{	
    Console.WriteLine( "Hello World!" ); 
    MessageBox.Show( "Hello World!"); 
}

@oleg-shilo
Copy link
Owner

It is a defect. The auto-class generation algorithm is missing static modifier for the method.

I will do a quick fix but until it is available you can use lowercase main as a workaround:

using System;
using System.Windows.Forms;

void main()
{	
    Console.WriteLine( "Hello World!" ); 
    MessageBox.Show( "Hello World!"); 
}

@oleg-shilo oleg-shilo added the bug Something isn't working label Nov 29, 2023
oleg-shilo added a commit that referenced this issue Nov 29, 2023
- Issue #8: hello_auto sample: Cannot find entry point
- `StartElevated` sample update
- added u-test
@oleg-shilo
Copy link
Owner

Done. You can download the release from here:
https://github.com/oleg-shilo/cs-script.net-framework/releases/tag/v3.30.7.0

@megakraken
Copy link
Author

Great, thanks alot!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants