views:

84

answers:

1

Hi - I'm reviewing a MVVM sample Visual Studio 2008 MVVM application as provided by MS. From the main start up assembly, the project has a "Models\Contacts.xml" directory structure. The main OnStartup method for the Application class references this file as MainViewModel.LoadContacts(@"Models\Contacts.xml");

My question is, how does Visual Studio add this folder and xml file to the bin\debug directory? When I clean the solution, the "Model" folder is still in the bin\debug directory, but the Contacts.xml file has been cleaned. Building restores the file. How does this mechanism work?

Thanks.

+1  A: 

Right-click the file and check the "Copy Local" property. If set to true, it copies it into the appropriate build directory so it can be accessed as a local resource with the deployment.

Plynx
Thanks, Plynx! Worked great! I made sure 'Build Action' was 'Content' and 'Copy To Output Directory' was 'Copy if newer'.
soulia