That Win32Resource property is not for icon files but for one compiled resource file as would be created by the resource compiler, RC.exe. If you were using the csc.exe compiler directly you would be able to use the win32icon option to add an icon for display by explorer.
Unfortunately the CSharpCodeProvider and CompilerParameters classes do not provide a win32icon property. However the CompilerParameters class does have a CompilerOptions string property to add any compiler options as text just as you would on the command line.
The example I'm pasting is just lifted from some code I have and hopefully is self explanatory.
private CompilerResults CompileCode(CodeDomProvider provider, String sourceFileName, String exeFileName) {
String[] referenceAssemblies = { "System.dll" };
CompilerParameters parameters = new CompilerParameters(referenceAssemblies, exeFileName, false);
parameters.GenerateExecutable = true;
parameters.CompilerOptions = @"/win32icon:""D:\VC\Projects\BCL\CodeDom\CodeDomTests\union flag.ico""";
CompilerResults cr = provider.CompileAssemblyFromFile(parameters, sourceFileName);
return cr;
}
Alan.