R – Why does the emulator start when testing compact framework applications

compact-framework

I'm using the MSTest system for unit testing my compact framework (3.5) application and DLLs. When I test some DLLs it just runs but for some it loads the emulator first. Can anyone tell me what determines whether the emulator is launched?

Best Answer

The testrunconfig file tells mstest which platform to deploy the tests to. However, if you have the configuration set to both build and deploy all of the DLLs, then the DLLs will attempt to deploy to their default target, not the target from the testrunconfig (yes, it's stupid and confusing).

The general rules I follow are:

  • Go through each project and set the target device to the same thing.
  • Use the Configuration Manager, and set to deploy only those items that won't be deployed due to being a dependency
  • Set the testrunconfig to match the target device from above