Home > Uncategorized, dotnet > More Fun With ClickOnce

More Fun With ClickOnce

November 12th, 2008 Leave a comment Go to comments

Keep It Simple album coverImage via WikipediaThe fun continues.

My
previous problems with the “Incorrect Function” error message when
running the bootstrapper turned out to be a corrupt VM. My current
issues revolve aroung trying to get one of Home Document Manager’s
components to find its resources when deployed.

In ClickOnce, each assembly
is deployed to its own folder, and you have no control over that
folder’s name. Since I have to manually load the resources, this
presented issues. Tonight I’m going to try adding the resources as
‘Data’ and having them copied to the ClickOnce app’s data directory.
This folder I can locate on disk so hopefully, security issues aside, I
should be able to load in the assemblies.

Reblog this post [with Zemanta]
  • Share/Bookmark
Categories: Uncategorized, dotnet Tags:
  1. November 12th, 2008 at 09:34 | #1

    Hi Tim,
    You can create configuration assembly that will be
    shared between your components and will save/load configuration from
    isolated storage for that assembly[via
    IsolatedStorageFile.GetUserStoreForAssembly()]. This will ensure that
    all components share same configuration.

    After ClickOnce deployment is finished, it runs application for the first time, you can use this to set up your configuration:

    if (ApplicationDeployment.CurrentDeployment.IsFirstRun)
    {
    MyConfiguration config = new MyConfiguration(); // class declared in shared configuration assembly

    config.MyComponentPath = Assembly.GetEntryAssembly().Location;
    config.Save(); // this will write config info to IsolatedStorage
    }

    hope it helps.

  2. November 12th, 2008 at 13:24 | #2

    Hi Jarek, nice to hear from you.

    That’s an interesting solution but can’t help in my particular
    scenario as they are third party non-assembly files. I think deploying
    them to the Data directory will be the only way, they will at least be
    migrated with upgrades.

  1. No trackbacks yet.