views:

40

answers:

0

Hi,

I am trying to build a .NET executable at run-time using VBCodeProvider but when I try setting the icon to embed in CompilerParameters.CompilerOptions I see that it works with path without spaces, like C:\Temp\App.ico but if I have some spaces inside it does not work.

It gives me the error:

Error creating Win32 resources: Error reading icon '"C:\Temp\My App.ico"' -- The filename, directory name, or volume label syntax is incorrect.

This is the string I am using

cp.CompilerOptions = "/optimize /target:winexe /win32icon:""C\My Program Files\app.ico"""

Do you know if I am doing something wrong and how to solve it?