0

I need to create a resource file for a .net project (by hand) and compile it using the ResGen.exe tool provided by the .NET framework. I can't find any documentation for this. I need to write the resource file by hand because I'm in a situation where I don't want to download/buy extra tools (like VS) to generate this resource file, and also I feel more productive through the command-line (helps me understand how things really work).

So I need to write a resource file by hand to store an ICON in the executable and use it from within my program. I would also like to use this icon to represent my executable in Windows Explorer.

Any references would be great!

1
  • This has been thoroughly answered in the following stack overflow thread. We've been using this implementation and it works great. It is also open source and integrates into MSBuild. Commented May 2, 2012 at 14:41

3 Answers 3

2

Visual C# Express Edition will do what you want for free. If nothing else you can download that, create the resource file and then use that as a subject for your admirable curiosity about 'how it really works'. This may also save you some time in manual experimentation to get it right the first time around.

Sign up to request clarification or add additional context in comments.

Comments

1

These 2 links in conjunction provide information on using that tool to create and embed an icon file, it seems specific to C#. Of course i'm guessing at your full intention, let me know if this points you in the proper direction.

http://www.xtremedotnettalk.com/showthread.php?t=75449

specifically there is a post which states; I think you should first create a *.resources-File from the Icon with the tool named "Resgen.exe"...

resgen App.ico App.ico.resources

the next step would be compiling...

csc /t:winexe /out:Keygen.exe /res:App.ico.resources /r:Crypto.dll /win32icon:App.ico Keygen.cs AssemblyInfo.cs

I'm sure you were here already. http://msdn.microsoft.com/en-us/library/ccec7sz1(VS.80).aspx

1 Comment

You use Resgen to compile a resx file and create the resource file. The question is how to embed the icon in the resx file so it can be compiled into a resource file.
1

You should check this link: http://msdn.microsoft.com/en-us/library/ekyft91f.aspx

It explains what formatter is used and gives some code samples to generate one from code. You could then write a small wrapper app that you can call from the command line. No downloads needed!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.