Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Loading application style failes running Click-Once Deployment application
posted

 Hello,

 I am using the AppStylist in a Windows Forms application. The style I am using is stored in a subdirectory, and at program start I am using this code to access the style:

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                Infragistics.Win.AppStyling.StyleManager.Load("Styles/Office2007Blue_Modified.isl");
 

The "Copy to output directory" attribute of the file is set to "Copy if newer" and running this code to initialize the styles has never been a problem.

Now that I publish my application using the "Publish" feature of the Windows Forms project (with feature "always run from shared path") and publish the application to a shared drive (or local drive for that matter) and run the application, it seems that the application can not find the style file and I get the exception:

Could not find a part of the path: "c:\documents and settings\myusername\Local Settings\Apps\2.0\97NE5X9H.DNB\K0DC3B00\vord..tion_{some cryptic hex coded string}\Styles\Office2007Blue_modified.isl".

Is there a way to fix this?

Markus

 

 

Parents
  • 37774
    posted

     Markus,

    I don't really have any experience with ClickOnce deployment, but instead of worry about whether a file is copied upon deployment, you might find it a lot easier to simply embed the ISL into your application and then load it from a memory stream (i.e. Assembly.GetExecutingAssembly().GetManifestResourceStream()).  In order to do this you would have to set the ISL to be an Embedded Resource.

    -Matt

Reply Children