Building and Running a Project

After you have created a project, you can build and run it.

Building the Project

To build a project:

  1. In the Visual Studio menu, go to Build > Build Solution.

    Build solution

    • Set the certificate in Tools > Options, if you see the Invalid signing Certificate error, as in the following figure. For more information, see Setting the Certificate Information.

      Invalid certificate

    • The .tpk file is generated when the certificate is set and there are no errors.

      Certificate is set

  2. Right-click the project item and select Open Folder in File Explorer.

    Open the project in File Explorer

  3. Open the .tpk file in the bin/Debug folder.

    Debug folder

  4. Inside the .tpk file, open the bin/Debug/packaging folder to see the source of the .tpk file.

    tpk file contents

  5. Install the .tpk file:
    • The .tpk file is installed for debugging when you click the debug start button (the button with a green triangle).

      The file installs after the build or after you have changed the debug device.

    • Manual installation:
      • Use the cd command to go to the debug folder.
      • Use the <path to sdb> install <TizenApplication>.tpk command to install the application. For example:

        c:\Program Files (x86)\Tizen\Tools\sdb.exe install XamarinApplication3.Tizen.tpk

    You get the following message:

    * Temporarily modified for Tizen build: C:\Users\...\.nuget\packages\Xamarin.Forms\2.3.3.163-pre3\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets 
       DebugSymbols = "$(DebugSymbols)" --> DebugSymbols = "false"
    * Temporarily modified for Tizen build: c:\users\...\documents\visual studio 2015\Projects\XamarinApplication10\packages\Xamarin.Forms.2.3.3.163-pre3\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets
       DebugSymbols = "$(DebugSymbols)" --> DebugSymbols = "false"
    

    The current Xamarin.Forms does not support .NET Core, which Tizen includes. For this reason, the Mono.Cecil assembly used by Xamarin.Forms has a problem with handling "portable" debug symbols used by .NET Core. The latest version of Mono.Cecil has fixed this problem, but it can take some time for Xamarin.Forms to include the fixed version.

    To overcome the problem in Tizen Tools, as a work around, modify the Xamarin.Forms.targets file a little so that it compiles. After the compiling has finished, it is restored to as it was before. This happens only when the Tizen project exists in the solution. A side effect of this action is that debugging codes related to XAML CS sources are not necessarily available with Visual Studio 2015. This action is removed when the fixed version Mono.Cecil is available to the public.

    The Automatically check for missing packages during build in Visual Studio option in the NuGet Package Manager can perform its actions after this change, so it is better to uncheck this option so that it does not restore while building.

Running from Visual Studio

  1. Go to Tools > Tizen > Run Emulator to run the emulator.

    Emulator

  2. Click Reset Emulator in case of a kernel panic or any other problem.