console application entry point for al option main

I have another post concerning how to embed an xml file in the assembly. But this question is deeper within. Thought a new post is warranted.

I can not determine the proper /main option setting for my console test application. (I have tried a variety and looked at ILDasm to no avail: main, assembly.main, console.main among others)

Can someone supply the correct option setting.

E:\VS8\TestStuff>al debug\TestStuff.exe /embed:productlist.xml /out:jkj.exe /target:exe /main:main
Microsoft (R) Assembly Linker version 8.00.50727.42
for Microsoft (R) Windows (R) .NET Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2003. All rights reserved.

ALINK: warning AL1020: Ignoring included assembly
'e:\VS8\TestStuff\debug\TestStuff.exe'
ALINK: error AL1037: Unable to find the entry point method 'main'




Answer this question

console application entry point for al option main

  • macroplay

    The target switch decides the output type of the linker operation; whether the .netmodule should be made into a library, exe or windows exe.

  • Attila Fogel

    If al.exe does not accept .exe files; then why does it have an option "target:exe"

    I have previously created .resources files with resgen. I was just hoping I could "more directly" store a xml file in the assembly, as I have seen done in C#. Guess I'll give the idea up and work toward a .resources solution.

    I got the idea from nobugz's reply to another post:

    "I'm guessing a bit because I haven't tried it but it looks like the Assembly Linker can embed a arbitrary file into an assembly. Run Al.exe with the /embed command line option as a postbuild step. At runtime, you can retrieve the embedded XML file with Assembly.GetManifestResourceStream()."



  • Lynette2

    Well... yes. that makes sense. My hopes ran away from my logic. Thanks for clarifying thing for me. (On to .resources!)

  • Gurpreet Singh Gill

    al.exe accepts .netmodules as input, not .exes. The compiler does this if you supply it with the /LN switch. Furthermore, /embed works on resource files, not individual resources. You'll have to somehow generate a .resources, then embed this instead. resgen.exe may be of help to you.



  • console application entry point for al option main