More Fun With ClickOnce
Image 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.
Categories: Uncategorized, dotnet
![Reblog this post [with Zemanta]](archives_files/reblog_e_002.png)
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.
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.