Click here to Skip to main content
15,889,736 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
//
// used compiler path:
// C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe"
//  Command-line:
// "csc.exe -t:exe -out:".\%~n0.exe" ".\%~nx0" -platform:anycpu -unsafe+ -w:0 -o 

using System;
using System.Text;
using System.Resources;
using System.Reflection;
using System.Diagnostics;
using System.Windows.Forms;
using System.Runtime.InteropServices;

[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyTitle("TrueFalseFS")]
[assembly: AssemblyCompany("Borderline")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyProduct("TrueFalseFS")]
[assembly: AssemblyDescription("Bool Fullscreen Mode")]
[assembly: Guid("ThisNeed-ToBe-Hidd-ing?-Overshadowed")]
[assembly: AssemblyCopyright("Borderline Copyright © 2020")]
[assembly: AssemblyTrademark("Borderline Copyright © 2020")]]

[assembly: Any Way add Ico + \path\ here, or some another place in code? )]]


What I have tried:

I don't know if the question is repeated or there is inconsistency, but I found nothing to signal me yes or no ...

I am using the assembler information in the source code itself, and that is because it is compiled on the command line, it is a hybrid script (bat/C#) that, at runtime, does "file restoration" by compiling a new one file.

The question is:
Is it possible to add a path/file to use an icon in the code itself as is already done with other configurations and assembler information?

Sorry my limited English...

// thank you
Posted
Updated 2-Aug-20 21:58pm
v2

I'm not sure exactly what you're looking for/asking - if you want to update resources in a C# exe, you can apparently use Mono.Cecil as per Use C# exe to modify resources of a different C# exe - Stack Overflow[^]

If you wish to change the icon for an exe using csc, have a look here -win32icon (C# Compiler Options) | Microsoft Docs[^]

(This all used to be easier in C++ iirc)
 
Share this answer
 
Comments
l o o l 2-Aug-20 23:49pm    
Thank you for comment, I know -win32icon, (/// "csc.exe -codepage:1252 -win32icon:".\%~n0.ico" -t:exe -out:".\%~n0.exe" ".\%~nx0" -platform:anycpu -unsafe+ -w:0 -o -nologo) but I need moving it to the code. I I'll see the link to stckSE link... again, thank you...
If you are building at the command line then you can create your own resource file to include in the build. See Resgen.exe (Resource File Generator) | Microsoft Docs[^].
 
Share this answer
 
Comments
l o o l 3-Aug-20 13:24pm    
Thank you so much, so I never used it, not even in vs, (which I’ve noticed) and I’m not sure how to start ...
Richard MacCutchan 3-Aug-20 15:23pm    
Start by studying the documentation, it gives examples of how to create resource files.
l o o l 3-Aug-20 16:13pm    
That's what I've been doing for the past few hours, it seems easier to migrate from FORTRAN FREE FORM to FIXED FORM than to do that, it looks like a cat's bed, I'm from the time when a compiler text editor did 99% of the process.

Thanks for the comment.
Richard MacCutchan 3-Aug-20 16:22pm    
Then switch to Visual Studio which does the work for you.
l o o l 3-Aug-20 16:34pm    
In this case, I need it 100% console, in a single hybrid C # // batch file, but I use VS, and in it I have the Intel Visual FORTRAN, but very little C # use. Give the reason for the question .. the other items I got very easily
That's what I was looking for, not relying on command line editing to add the relevant icon. Simple as the other customizable options:

using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyIcon(@"D:\The\Full\Path\To\File.ico")]

namespace NameSpace
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900