Child pages
  • How to profile .NET Compact Framework applications
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 23 Next »

Prerequisites:

Host computer software:

  1. ActiveSync (for Windows XP, Windows Server 2003) / Windows Mobile Device Center (Windows Vista / Windows Server 2008 / Windows 7)
  2. .NET Compact Framework 2.0 SP1
  3. .NET Compact Framework 3.5 SP1
  4. Visual Studio 2005 SP1 or higher
  5. Windows Mobile 6 SDK
  6. PowerToys for .NET Compact Framework 3.5 (or higher)

Mobile device software:

  1. .NET Compact Framework 3.5 SP1 (NETCFv35.wm.armv4i). If you are running from VS, it is installed automatically. If it is not installed, you can get it from "C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE"
  2. Your Windows Mobile application to test
    Icon

    It may be necessary to place a config file to the application folder. The config file should follow the naming pattern <ApplicationName>.exe.config and contain the following data:

    where

    is your .NET Compact Framework version.

How to:

  1. Connect your device (optional if you plan to use emulator)
  2. Start dotTrace.
  3. Profile -> "Smart Device Application".
  4. Add new Host. Select your device from the list.
  5. Provide Path to the application at the device.
  6. OK. The selected application will start at the device. Exercise it. Get Snapshot. We are done.

Possible known problems:

1. In Tracing mode - Error "Invalid Index".

Most likelу the error is caused by the known bug in CompactFramework 3.5.

The best workaround is switching to Sampling profiling type.
 
More about the bug. If there is any exception in the application, which gets out of the Method, Property etc. then in Tracing mode the profiler stops getting notified about some framework events and thus fails.

Here is an example of the valid code:
try
{ throw new NotImplementedException(); }
catch
{ //do something; }

And the example below will cause "Invalid Index":
private void button1_Click(object sender, EventArgs e)
{
try
{
MethodThrowingEx();
}
catch
{ //do something; }
}
}

private void MethodThrowingEx()
{ throw new NotImplementedException(); }
2. Can't connect to the host. Unsupported instruction set.
Most likely you are trying to profile Windows CE 4.x, which is not supported by dotTrace 4.0.

3. The operation has been cancelled.

There are two known possible reasons:

a) At some devices confirmation dialog appears. And if you do not agree, then you will get this error.

b) There is a timeout 1 minute for coping profile core dll and profiler core pdb to the device Windows folder. If the communication speed is rather low then you might get this error.

How to diagnose?

Start profiling when it starts and go to the device Windows folder. Search for JetBrains.Profiler.Core.WinCE.YourProcessorType.dll and JetBrains.Profiler.Core.WinCE.YourProcessorType.pdb.

Search the same files at dotTrace bin folder (C:\Program Files (x86)\JetBrains\dotTrace\v4.0\Bin). If they are different sizes when you get an error message, it means that the speed was too low.

If you are using release build you will not see pdbs, they are not included, but if you are using nightly builds they are included.

The current workaround for the nightly build is to delete pdb file from dotTrace installation folder manually (It may be someting like C:\Program Files (x86)\JetBrains\dotTrace\v4.0\Bin).

4. Missing dll file JetBrains.Profiler.Core.WinCE.ARMV4I_fp.dll
This issue was fixed. Please, download new dotTrace version from http://confluence.jetbrains.net/display/NetProf/4.0.1+Nightly+Builds

  • No labels