Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codedom compiler icon options error

I am working with Codedom, to compile individual Exes with custom icons.

This is the code that I am using to specify the icon file:

string temp;
temp = string.Format("/target:winexe /win32icon:{0}", testico);
cp.CompilerOptions = temp;

testico in this case is a string, specifying where the icon is located.

Now the problem is, the code above only works if there are no spaces in the file path.

Therefore, to allow filepaths with spaces, I modified the code to this:

string temp;
temp = string.Format("/target:winexe /win32icon:\"{0}\"", testico);
cp.CompilerOptions = temp;

Unfortunatly, this does not work.

Any ideas? thanks

like image 322
Sihan Zheng Avatar asked Jun 28 '26 14:06

Sihan Zheng


1 Answers

Try:

\"/win32icon:{0}\"

The quotes surround the entire argument

like image 167
Marc Gravell Avatar answered Jul 01 '26 06:07

Marc Gravell