where is user.config? - vb.net

in vb.net i am trying to save application settings but for USER but i cannot find the user.config file
when does this file get created?
i searched my entire hardrive. i also searched the entire project.

The user.config file is typically stored in their profile directory under the following structure:
Profile Directory\Company Name\App Name_Evidence Type_Evidence Hash\Version\user.config
Have you checked there?
EDIT: Taken from the article to help cover ambiguity about the path descriptions:
Profile Directory - is either the
roaming profile directory or the local
one. Settings are stored by default in
the local user.config file. To store a
setting in the roaming user.config
file, you need to mark the setting
with the
SettingsManageabilityAttribute with
SettingsManageability set to Roaming.
Company Name - is typically the string
specified by the
AssemblyCompanyAttribute (with the
caveat that the string is escaped and
truncated as necessary, and if not
specified on the assembly, we have a
fallback procedure).
App Name - is typically the string
specified by the
AssemblyProductAttribute (same caveats
as for company name).
Evidence Type and Evidence Hash -
information derived from the app
domain evidence to provide proper app
domain and assembly isolation.
Version - typically the version
specified in the
AssemblyVersionAttribute. This is
required to isolate different versions
of the app deployed side by side.

You don't need to know where it is (and it's different under XP and Vista)
All you need to do is
Settings.Default.Save();

Related

Change default destination folder for the Copy Database Wizard

Is there any possibility to change the default destination folder for the Copy Database Wizard in SQL Server Management Studio 17?
Changing the database default location via the database properties does not work.
This are the default paths configured for the database server:
If you single-click in the area of the dialog where it has the destination paths (highlighted in yellow), it magically turns into an inplace editor where you can enter your custom paths. Of course, it leaves some questions. Why did they hide it in an easter egg? Why don't they just read the configuration file containing the paths you specified in the first place?
My guess is that Microsoft decided to take punitive measures on users who explicitly changed the paths of the database files. Since it makes their coding more difficult to open a configuration file and parse it, they felt it would only be fair to make it equally hard for you to get any benefit from changing paths.

How do I change the location for a (single) filesystem in Ravendb?

My task: to move the directory containing the databases and filesystems for a Ravendb-installation from one drive to another (because of disk-space issues) without moving or altering the Ravendb-installation itself.
I managed to move the databases by:
shutting down the Ravendb service
Moving the data-folder containing the subfolders Databasesand FileSystems
Opening Raven.Server.exe.config and changing the value for the settings Raven/DataDirand Raven/FileSystem/DataDir
Starting the Ravendb service again
Tricky part: going to some (not all) databases using Raven Studio and choosing Settings > Database Settings and changing the value here (again) for Raven/DataDir. So apparently, somehow, for some of my databases, this value was overridden in some metadata for the db itself rather than using the tilde to look relatively to the global setting (although the actual db or db definition or something was being loaded correctly, since I could even see this setting/value)
So far so good. But here the problem:
Apparently, too, for some filesystems (again not all), Ravendb seemed to think, their "data-data" was still in the old location (again, the actual filesystem metadata seemed to be loaded from the new location). But alas, filesystem do not have something similar to Database Settings in Raven Studio where I could change this data-dir, probably overridden here too.
The way I know the filesystems' data is assumed to still be in the old location, is that I can see new folders being created in the old location with the name of the respective filesystems.
I tried going to the system db (Main Window > Manage Your Server > To System Database), but the file-systems do not appear here.
So my question is: how can I change or set the Raven/FileSystem/DataDir setting for a single filesystem?
Eureka, I found this out:
The error was indeed, that for some reason, my filesystems do not appear in the system db when viewed in Raven Studio. I realized this, because the status-bar in the system db said 40 documents, but fewer were visible in the list. This must definitely be a bug in Raven Studio.
The solution: In system db, put my mouse cursor in the quick-goto-/search-field in the top ("Go to document") and typed Raven/FileSystems/ and from here on, the autocomplete would show me the available filesystems. Choosing the correct filesystem, I was now able to edit the (indeed overridden) path to the filesystem, which was set to an absolute path.
Note, that in general you should definitely use a path relative to the Raven/DataDir and Raven/FileSystem/DataDir settings, like e.g. ~\filesystems\my-db to more easily be able to move all dbs and fs'es around collectively.

Where does Windows Store apps stores its local settings?

Hello fellow programmers,
I am new to Windows 8. Where does Windows Store app's LocalSettings store its serialized file ? I am referring to this one:
Windows.Storage.ApplicationData.Current.LocalSettings
Per WinStore app tutorial here, I can load and save serialized properties to either roaming settings or local settings. The roaming goes to the cloud, but where exactly does the local setting goes to ? Registry? Isolated file?
Thank you in advance.
Look in c:\users\{username}\AppData\Local\Packages\{packageID} where packageID identifies a particular app. In there you'll see a number of folders, and inside the one called Settings you'll see settings.dat. That's where the LocalSettings and RoamingSettings are stored. (Roaming settings are stored locally and sync'd with the cloud, so you aren't hitting the cloud every time you want to retrieve one.)
The LocalState, RoamingState, and TempState folders alongside Settings are where you can store your own files if what you want to store in settings gets too complicated for key-value pairs.

Can You "Tag" a file in Vb.Net?

In Vb.Net is there any way to "tag" a file so if I was to change its location my program could still find it, without the user having to search for it?
I am using:
If Not System.IO.File.Exists(C:\Location\Folder\FileName.txt) Then System.IO.File.Create(C:\Location\Folder\FileName.txt)
If it is the program that is changing the location of the file, then you could store the current location in the registry, in the app's config file, in a database, or in a plain text file in a known directory near the application.
I generally store this information in the registry or a database (assuming the application uses one) since this will survive uninstall and reinstall events.

Sharepoint Workspace 2010 Local Store Location

When setting up local synchronization with a Sharepoint 2010 site using Sharepoint Workspace, where are the local files stored? More importantly, how can I change the storage location?
There is a folder-like object created under username\Workspaces, but when checking the path in the explorer address bar, it shows simply username\Workspaces, unlike other folders that show as C:\Users\username\xxxx. Right clicking the folder only provides the option to open in new window - it can't even be deleted! There are no options for setting storage location within the Workspace application itself.
Using an SSD system drive, I don't have the space to put all this data on C:. Only part of my user profile has been relocated to other drives, so the default for new items is still C:. Without a knowledge of the real path where this is stored, I can't even use junction points to redirect.
Much web searching has revealed nothing on this subject. Your help is appreciated.
the data is stored within the users profile. I don't think taht you're able to relocated the synched database. The synchronized data isn't encrypted or password protected. So you should consider to activate profile encryption within your organization.
In addition to the location you aren't able to activate any kind of OOB protection for the local SQL CE which is responsible for storing the synched data!
The default location is %localappdata%\Microsoft\Office\14.0\OfficeFileCache.
The files in this location don't look like the actual files, and contain a lot of metadata.
Per Microsoft KB 2020636, you can change the location of the OfficeFileCache by adding an Expandable String Value named OfficeCacheLocation to registry subkey HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\Internet with the new path. (This key is for Office 2010 only.)
In my organization, we reviewed the option of using Workspace for making files available offline, but in the end opted for a third party SharePoint add-on.
Since all of out users have Outlook and use it on daily basis, it made sense to have an Outlook sidebar available with all the users' relevant files. It also can synchronize a SharePoint library or folder and makes its items available offline using Microsoft Outlook, so we opted to use it instead of the OOB feature, which was too limited and had various security problems.
Just came across this and I think this will do the trick: How to change the default location of the Office 2010 Document Cache (NB: I haven't actually done it myself yet).
I don't have enough "reputation" on this site to post additional links, but if you search on the following, you can find more background:
OfficeFileCache Folder Size 3-4x Larger than Actual Content (SharePoint Workspace 2010)
Sharepoint Workspace Fills Hard Drive – WTF?