views:

246

answers:

2

I have problem with copying sdf file to WM emulator.

My solution structure

  • MyApp.DataLayer - there is sdf file
  • MyApp.WMUI - this is windows mobile winform app

sdf file has set

  • build action: content
  • copy to output directory: copy always

But if I deploy app to emulator, that sdf file doesn't copy.

+1  A: 

If I understand your structure correctly, you have a WinMo app and an SDF file in a separate project (presumably a class library). When you deploy the WinMo app, Visual Studio will copy over all the necessary files from your WinMo project, but only copy over the DLL from the class library (and not any files in the DLL, like the SDF file).

You have a few options:

  1. Put the SDF file directly in your WinMo app project; there is no real reason that you have to have the SDF embedded in your DataLayer project (there's also probably no real reason to have a separate DataLayer project at all, but that's a different issue). The SDF file will then deploy with the app as you expect.
  2. Build and Deploy the DLL project along with the WinMo app. This will build the DLL and copy it and any included files over to the PDA. I don't recall exactly where it will be put, and anyway you'd want to change the deployment target to the same folder as your WinMo application (so that after Deploy the DLL and the SDF will be sitting in the main application folder).
  3. Merge DataLayer and WMUI into one project. Since you presumably also have a WINUI project somewhere, this may not be feasible.
MusiGenesis
Thanks for your answer. Based on that I try Add as Link, at it works how I expect.
MicTech
+1  A: 

Add sdf file to WinMoUI project as Link.

MicTech