I’m testing my clickonce deployment (WPF, .Net 4) and I can’t seem to access the data directory. The application is installed and can run offline so I need a way to access the data directory when !ApplicationDeployment.IsNetworkDeployed
My manifest is correct and the data file is marked as such. The file is indeed copied to the Data directory in C:\Users\MyUserAccount\AppData\Local\Apps\2.0\Data… (Windows 7)
I’ve tried:
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
and
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
… both functions return nothing and do not throw any errors. I can retrieve the BaseDirectory of the application but that doesn’t help me getting the data file.
The data file is posdm.exe. A POS for .Net utility program I need so that I can set defaults on hardware connected to the POS machine. I just need to figure out how to access it from the installed data directory.
Edit
Seems like its related to the separate AppDomain I create. It’s not pulling in the ApplicationDeployment properties from the main AppDomain
I had pass the applications main AppDomain variables to the separate AppDomain I created. The AppDomain I created didn’t have the same values as the main AppDomain: