Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Monday, October 22, 2018

C#: End-to-End PowerBI Embedding - "App Owns Data"

In working with a number of developer-heavy customers, there seems to be a strong demand for taking the reports and dashboard developed in PowerBI and publishing them in either Intranet or Internet web pages.  This concept is currently known as PowerBI Embedded and comes in several different options for developers to implement.

Licensing and Disclaimer

Before we start, I will note that there are definitely licensing concerns and implications to choices made as a part of this tutorial.  While I could likely articulate the current rules surrounding PowerBI licensing, there are a variety of options and I am not truly qualified to explain all of these nuances. . . .so I won't even try.
PLEASE seek assistance from your Microsoft account team if you choose to Embed PowerBI in your applications to determine what licensing model works best for your organization.
Additionally, technologies frequently change.  I will make every attempt to update this tutorial as functionality and technology changes, however for the most current up-to-date information, you should always refer to the Microsoft PowerBI developer documentation, and never any individual tutorial (including this one).

Step 0: Make Some Choices

Before we begin, lets discuss some of the options available to developers who are trying to embed their report.  At it's simplest, developers can place their PowerBI reports in a web page by using an HTML IFRAME on their site and ensuring they have a pointer to the correct PowerBI report.  Here are a simplified list of options:

Option A - Publish to Web

The simplest way to get a PowerBI report into your website is to use the "Publish to Web" option in PowerBI.com.  Just publish your report from the PowerBI client application, and from the File Menu choose "Publish to Web".  This is an entirely public method of publishing though, and there is NO way to lock down ANYTHING.


Option B - User Owns Data

The second option is currently termed "User Owns Data", and in this model, each user who logs into your website with a valid Azure AD account will be allowed to see what they're permitted to in any given PowerBI Report.  Great for Intranet sharing where you know all of your users and trust their Azure AD sources.

Option C - App Owns Data - FOCUS OF THIS TUTORIAL

The third option is currently known as "App Owns Data" and leverages what is essentially a single service account to publish the report as that service account user.  Great for situations where you are publishing a report on a public website where users will not be logging in before they see your PowerBI report. 

Assuming you chose to go with Option C above, the rest of this tutorial will walk through how to implement this.  You can also follow the tutorial linked in the Option C section above, but these steps should simplify the official tutorial some more.

Step 1: Develop a PowerBI Report

While it may seem obvious, this first step is important to leveraging some of the tools to their greatest extent.  You can change your specific report later, however for the purpose of following the PowerBI Embedding wizard, it's easiest to have a .pbix file on hand as you embed your first report.
The easiest way to develop your first report is to download the PowerBI client and create a report to embed.  If you haven't done so already, you may download the PowerBI client from powerbi.com.

Step 2: Obtain a Service Account

This approach assumes that a service account user will be logging into PowerBI on behalf of your application, therefore, you will need to have a fully licensed PowerBI user [with password] created. Speak with your organization's Azure AD administrator and have them authorize the new user for PowerBI in the Office Portal (portal.office.com). 

Step 2a -Test Logging In with Service Account

Just to be sure your user was provisioned correctly (and has access to PowerBI), PLEASE login to Powerbi.com with your new user and ensure they can use or see a report (ideally the one you created above in Step 1).

Step 3: Use the Wizard!

The PowerBI product group recently developed an amazing wizard to walk users through the process of creating and embedding reports in your website.  Navigate to the wizard at https://app.powerbi.com/embedsetup and choose the option labeled "Embed for Customers".  If you are using PowerBI Government, the same wizard is available to you at https://app.powerbigov.us/embedsetup.
The following are some important notes for as you walk through the wizard:
StepNote
Step 1 - Sign InSign in with your new service account. If you do not login with your service account, your "user" will never have the chance to accept terms and conditions (Step 5), and you will get some strange unauthorized error in your code.
Step 2 - Register Your ApplicationThe PowerBI report you are creating needs to be registered in Azure Active Directory so that OAuth can be used to verify your user has rights to the report being published. The official Microsoft tutorial goes into great detail on what this means and why, but for now, just give your application a name so that it gets permission to use the embedded objects.
Step 3 - Create a WorkspaceEven though you probably already have a PowerBI workspace, just let the application create one for you. Your code can be updated later.
Step 4 - Import ContentSame as above. Even though you've probably already created a report, just for now, provide it a .PBIX file so that it creates another one for the sample source code that comes out of the wizard.
Step 5 - Grant PermissionsSince this service account is acting like a user, and every user needs to accept terms and conditions when using Azure AD for Oauth. . . .you'll need to allow your application and user to be related with one another in this step.

Upon completion, you should see an option to download sample code.  Download this .zip file and unzip it somewhere you can open it in Visual Studio 2015 or higher.

Step 4: Modify the Sample Solution Code

Open the .sln file you just downloaded in Visual Studio and navigate to the web.config.

Step 4a - Add Password to Web Config

The solution should have everyhing you need. . . EXCEPT a password.  While we should NOT publish this code (nor check it into source control) with a password in our code, for now we just want to be sure everything is working.  Add your password to the AppSettings section where you see the blank.



Step 4b -  Restore NuGet Packages

From the Tools Menu, navigate to the NuGet Package Manager and choose the option to restore packages not currently in the solution.



Step 4c - Update NuGet Packages (Optional)

If you will be publishing your work to a modern web server, you will likely want to update your packages to ensure any vulnerability and server-side incompatibilities are addressed before being published.  


Step 4d - Build and Run

If it worked, you should see a set of 3 buttons. . . if you pick Embed Report, the following should show without an error:


Step 5: Secure Your Identity

Now that we know it works, you will now want to go through and hide your service account's login in something other than plain text in the web.config file.

In the next article we will go through the options for securing your identity if you are using an Azure Web Service.  Stay tuned!

Friday, June 22, 2018

C#: Azure Government Development in Visual Studio 2017

A lot of government developers I've worked with over the past several weeks were all curious how to  implement and deploy Cloud-based solutions to Azure Government from their Visual Studio environments.  This brief tutorial goes through the steps currently required to configure Visual Studio 2017 (any version) to publish cloud services.

Step 0 - Verify Visual Studio has the Azure SDK

Before working with any Azure cloud service (Government or Commercial), Visual Studio must first have the Azure SDK installed on it.  This provides a great many pre-defined templates and class libraries that developers can use in building their solutions.  

To ensure your version has the Azure SDK installed, simply try to create a new project and look for the Cloud option under your preferred language and see that templates are displayed as shown in the following:


If you do NOT have these, click on "Open Visual Studio Installer" at the bottom of the left panel to fire it up and download the Azure SDK.

Step 1 - Install the Azure Environment Selector

Out-of-the-box today, Visual Studio expects developers to be accessing and publishing to the standard Azure Commercial or Enterprise Cloud.  Since we are going to be working in the Government cloud, we have to switch the configurations inside of Visual Studio.  Rather than do this manually every time from the command prompt or a text editor, we'll be installing the Environment Selector "extension" instead.  

From the Tools menu, select Extensions and Updates


From the Extensions window, find and download the "Azure Environment Selector" extension.


Once downloaded you will see an alert at the bottom of the window next to the Close button that alerts you this will be installed once you exit Visual Studio.  



Exit Visual Studio and you will be prompted with the Visual Studio Extension installer to modify Visual Studio.


Step 2 - Switch Environments

Upon returning to Visual Studio, you should now see a new item on the Tools menu for the Environment Selector.


Clicking on this new menu item will bring up a dialog box allowing you to change from the Commercial Cloud to the Government Cloud.  Once selected this will require a restart of Visual Studio in order to take effect.


Step 3 - Publish Cloud Projects to Azure Government

Now that Visual Studio is targeting Azure Government, open (or create a new) Cloud-Based project and from the project name in the Solution Explorer, right click and "Publish" your service.


Visual Studio will take you to a Publishing wizard that allows you to publish a new service or replace an existing one.  


Before you can complete the publishing process, you will need to login to Azure Government with your credentials (shown in the top right of the screen as shown here:



Monday, June 11, 2018

C#: Sharing a Visual Studio Pro 2017 Project on GitHub

This article will go through and provide a step-by-step guide on how to post a Visual Studio 2017 Project and Solution to a newly established GitHub Repository (repo).  As with many tools, there are a multitude of paths to take and different ways to accomplish a task like this.  This just provides one possible path to accomplish this task.

Step 1 - Add GitHub Tools to Visual Studio

Before we can use GitHub from within Visual Studio 2017, we need to install the plug-in to make it easier to manage.  You can of course just use Git from the command line as well. . . .this article instead looks at the GUI though.
From the Tools menu, navigate to Extensions and Updates.


Once the Extensions and Updates window opens up, navigate to the "Online" item and search for "GitHub".  The "GitHub Extension for Visual Studio" (the one with the official GitHub icon) is the extension you're looking for.  Find it and Install it.  


Step 2 - Configure the Team Explorer

For this next step, I'll assume you have the Professional or Enterprise edition installed with Team Explorer functionality.  Navigate to the Team Explorer if you don't already see it on your screen by going to View >> Team Explorer.


In the Team Explorer window, click on the plug-shaped connections icon to add a new connection to GitHub.


From here, we need to login to GitHub with your GitHub account (just go sign-up for a new account if you don't have one yet). 

Step 3 - Create a New GitHub Repo

Now that you've connected GitHub to your Visual Studio environment, you should see your existing GitHub repos listed in the Team Explorer Connect screen.  For this tutorial, we'll create a new repo for a new project by clicking on the "Create" link and entering some details about the repo in the accompanying pop-up window.


WARNING: you will not be able to mark the repo as "Private Repository" unless you have a paid GitHub Account.  Free accounts are only available publicly for all to see.  Again, just to reiterate. . . .the new repo you create will, by default, be PUBLIC and available for ANYONE to see.  

Assuming your create request was successful, you will see a resulting success alert in the Team Services window.

Step 4 - Create a New Solution & Project In the Repo

Now that we have a repo, we can navigate back to the Team Explorer Tab and select our newly created repo to make it active in our work-space.


Once selected, the "Home" subtab inside of the Team Explorer should open and present you with a list of actions you can take with the repo.  Initially, we see that no project has been created or associated with this repo, so we will choose the "New.." link under Solutions.


This will bring up the familiar New Project wizard to allow you to pick your project type and name your project.  For this demo, we will just create a sample web project.


Once created, we can navigate back to the Solution Explorer and see our project exists and source code control icons exist next to each file to denote the status of each file under source control.  By default, Visual Studio includes all relevate source code files but one can add items to be excluded (e.g. add them to the .gitignore) pretty easily later on the commit page.


You should also note, that the toolbar at the bottom of the Visual Studio window now shows a number of Git-related icons that can be interacted with to view edits, make a pull request and select the active branch you are working in at the moment.

Step 5 - Commit Your Work Locally

Git, as an open standard, allows users to work locally on their machines with a copy of the source code in a local repo, and then when satisfied the code is correct, it allows you to commit your changes locally first, then eventually (and separately) commit your code externally to your server or cloud provider.
The first part is committing our work to our local repo hosted on our machine.
In order to do this, we simply click on the pencil icon in the toolbar, or choose "Changes" from the Team Explorer.



Step 6 - Commit Your Code to Cloud

Now that the code has been committed locally, it's time to commit our changes to the GitHub servers.  In order to active this process, we simply choose "Sync" from the Project Explorer to allow Git to see if anyone has already made changes on the server that need to be resolved on our client before posting our changes.  


Once Git has done its job and you have addressed any conflicts, the changes can be "Pushed" to the cloud from the Sync page.


If the push was completed successfully, a warning appears on the Team Explorer like so:


And you can navigate to https://www.github.com/ to see that your project is now accessible in the new Git Repo you created.


Thursday, January 28, 2016

C#: Barcode Scanning with Windows Phone 8

While a little off-topic, this post will focus on how to implement barcode scanning within a C# Windows Phone application.  Several times in the past year I have needed this functionality, so rather than continue to re-open my past Visual Studio project files, I'll instead share what I've found and how to make it work.  This article will provide a step-by-step approach to adding barcode functionality into your C# Windows Phone application and can be modified somewhat if needed for other Windows Platforms.
For those interested, I've provided a full sample project here for your reference.

Step 0: Create or Open your C# Windows Phone Project

This article assumes the reader already has a base understanding of using Visual Studio and has already created a Windows Phone 8 or 8.1 project inside of Visual Studio (any edition). 

Step 1: Add ZXing to your Project

Thanks to the makers of the ZXing library, the open source community has shared an amazing set of utility code to read and parse image data for barcodes.  This solution makes use of the ZXing port over to .NET called ZXing.net
Additionally, the ZXing.net community has made their library available through NuGet, which makes adding it to your project a trivial matter.  To use the NuGet package, open the package manager from the Project menu as shown in the following:


Once open, search for the ZXing.net package, and add it by clicking the checkbox associated with the platform being supported (WP8-Barcode in this example).


Once completed, this will install the required package into your project and add all required references. 

Step 1 [Shortcut] – Install from Package Manager

Many of the more seasoned developers will know, you can simply add the project to your file by using the package manager command prompt instead. 
Install ZXing.net

Step 2 – Add Library Includes (‘using’) References to Page

In order to leverage the camera, image manipulation and ZXing libraries in your code, for ease of use, you’ll want to add references to the libraries to the top of your source code.  The following will be required:
using Microsoft.Devices;
using ZXing;
using System.Windows.Threading;
using System.Windows.Media.Imaging;
using System.Windows.Input;

Step 3 - Create XAML Screen as a Viewfinder

Before diving into the c# event handlers and such, lets setup a simple viewfinder where we can show the camera contents, and for this example, simply display whatever barcode we've processed/read. To do this, something similar to the following XAML would be required.

<phone:PhoneApplicationPage
    x:Class="WP8_Barcode.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="200"/>
        </Grid.RowDefinitions>


        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock Text="WP8 Barcode" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
            <TextBlock Text="scan barcode" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Canvas x:Name="viewfinderCanvas" Margin="0,0,0,10">
                <!--Camera viewfinder -->
                <Canvas.Background>

                    <VideoBrush x:Name="viewfinderBrush">
                        <VideoBrush.RelativeTransform>
                            <CompositeTransform
                                x:Name="viewfinderTransform"
                                CenterX="0.5"
                                CenterY="0.5"
                                Rotation="90"/>
                        </VideoBrush.RelativeTransform>
                    </VideoBrush>
                </Canvas.Background>
                <TextBlock 
                    x:Name="focusBrackets" 
                    Text="[   ]" 
                    FontSize="40" Visibility="Collapsed"/>

                <TextBlock Canvas.Left="100" TextWrapping="Wrap" Text="Tap to read the Barcode" Canvas.Top="200" Width="233" FontFamily="Segoe UI"/>
            </Canvas>
            


        </Grid>
        <StackPanel Grid.Row="2" Margin="20, 0">
            <TextBlock Text="Barcode Type:"/>
            <TextBlock x:Name="tbBarcodeType" FontWeight="ExtraBold" Text="[Please Scan]"/>
            <TextBlock Text="Barcode Data:"/>
            <TextBlock x:Name="tbBarcodeData" FontWeight="ExtraBold" TextWrapping="Wrap" Text="[Please Scan]"/>
        </StackPanel>

    </Grid>

</phone:PhoneApplicationPage>

Step 4 - Define the Private Local Variables Required


Several of the core objects we'll be using will have a scope beyond the method being executed, therefore we will need to define some private variables to hold pointers to these objects.
//private locals
private PhotoCamera _phoneCamera;
private IBarcodeReader _barcodeReader;
private DispatcherTimer _scanTimer;
private WriteableBitmap _previewBuffer;

Step 5 - Initialize the Camera and Add Event Handlers

This can be done anywhere in your code (for example on a button press), but for this example, I've added it to the OnNavigatedTo method.
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            // Initialize the camera object
            _phoneCamera = new Microsoft.Devices.PhotoCamera(CameraType.Primary);

            //event callbacks defined
            _phoneCamera.Initialized += new EventHandler(cam_Initialized);
            _phoneCamera.AutoFocusCompleted += _phoneCamera_AutoFocusCompleted;
            CameraButtons.ShutterKeyHalfPressed += CameraButtons_ShutterKeyHalfPressed;
            viewfinderCanvas.Tap += new EventHandler(focus_Tapped);

            //Display the camera feed in the UI
            viewfinderBrush.SetSource(_phoneCamera);


            // This timer will be used to scan the camera buffer every 250ms and scan for any barcodes
            _scanTimer = new DispatcherTimer();
            _scanTimer.Interval = TimeSpan.FromMilliseconds(250);
            _scanTimer.Tick += (o, arg) => ScanForBarcode();


            base.OnNavigatedTo(e);
        }
As shown above, the device's camera object needs to be initialized, callbacks assigned to the event methods (see later steps for each of these callback definitions), and a timer initiated to periodically get whatever is in the camera buffer. This could also be changed to only grab the camera buffer on an event of some kind (e.g. camera button pressed, screen tapped, etc.) but for this example, it has been just established as a periodic 250ms.

Step 6 - Include an Autofocus Completed Event Handler

The viewfinder in this example includes a set of brackets '[ ]' in the UI to allow the user to define the point of focus when they tap the screen. Once the autofocus has been completed, this callback method is triggered to simply show where the brackets should appear on the page.
void _phoneCamera_AutoFocusCompleted(object sender, CameraOperationCompletedEventArgs e)
        {
            Deployment.Current.Dispatcher.BeginInvoke(delegate ()
            {
                focusBrackets.Visibility = Visibility.Collapsed;
            });
        }

Step 7 - Include a Screen Tap Event Handler

To support focusing on a single point within the virtual viewfinder, we have to add an event handler for the screen tap event (see OnNavigatedTo method above for where the event is assigned).
void focus_Tapped(object sender, System.Windows.Input.GestureEventArgs e)
        {
            try
            {
                if (_phoneCamera != null)
                {
                    if (_phoneCamera.IsFocusAtPointSupported == true)
                    {
                        // Determine the location of the tap.
                        Point tapLocation = e.GetPosition(viewfinderCanvas);

                        // Position the focus brackets with the estimated offsets.
                        focusBrackets.SetValue(Canvas.LeftProperty, tapLocation.X - 30);
                        focusBrackets.SetValue(Canvas.TopProperty, tapLocation.Y - 28);

                        // Determine the focus point.
                        double focusXPercentage = tapLocation.X / viewfinderCanvas.ActualWidth;
                        double focusYPercentage = tapLocation.Y / viewfinderCanvas.ActualHeight;

                        // Show the focus brackets and focus at point.
                        focusBrackets.Visibility = Visibility.Visible;
                        _phoneCamera.FocusAtPoint(focusXPercentage, focusYPercentage);
                    }
                }
            }
            catch (Exception ex)
            {
                _phoneCamera.Initialized += new EventHandler(cam_Initialized);
            }
        }

Step 8 - Include a Half-Press Camera Button Handler

As with the above, if our device supports half-presses from the camera button, use it to trigger the camera's autofocus.
void CameraButtons_ShutterKeyHalfPressed(object sender, EventArgs e)
        {
            _phoneCamera.Focus();
        }

Step 9 - Include some final Configuration in the Camera Initialized Event

Some final configuration can be added once we know the camera is initialized, and we can begin our camera scan timer and start attempting reads. Optionally, this timer can be removed and only await a camera press or screen tap.
void CameraButtons_ShutterKeyHalfPressed(object sender, EventArgs e)
        {
            _phoneCamera.Focus();
        }

Step 10 - Include Scan for Barcode Logic

We add this method to save temporary images to the camera buffer and we make calls to ZXing to decode the content within this buffer.
private void ScanForBarcode()
        {
            //grab a camera snapshot
            _phoneCamera.GetPreviewBufferArgb32(_previewBuffer.Pixels);
            _previewBuffer.Invalidate();

            //scan the captured snapshot for barcodes
            //if a barcode is found, the ResultFound event will fire
            _barcodeReader.Decode(_previewBuffer);
        }

Step 11 - Add a Barcode Found Callback

This method is called whenever ZXing yields a result from the decoding attempt. This is where we can add logic to parse the barcode data, save it in memory, or even navigate away from the screen if we just wanted to scan a single barcode.
void _bcReader_ResultFound(Result obj)
        {
            // If a new barcode is found, vibrate the device and display the barcode details in the UI
            if (!obj.Text.Equals(tbBarcodeData.Text))
            {
                VibrateController.Default.Start(TimeSpan.FromMilliseconds(100));
                tbBarcodeType.Text = obj.BarcodeFormat.ToString();
                tbBarcodeData.Text = obj.Text;
                //do something real with the scan (e.g. persist it to a the State or ViewModel object before you leave the page)
                //PhoneApplicationService.Current.State["Text"] = obj.Text;

                //Navigate to some other page if you're done scanning
                //NavigationService.GoBack();
                //NavigationService.Navigate(new Uri("/PageYouWantToGetResult.xaml", UriKind.Relative));
            }

        }

Step 12 - Include Cleanup Logic

With camera and device access on Windows Phone, it is ABSOLUTELY CRITICAL that we cleanup our variables once we're done with them. If omitted, it is possible for your camera to keep on capturing and processing data, leaving flashes flashing, and simply crash your application. We've chosen to include all the cleanup code in OnNavigatedFrom method, or is automatically called by the system when a user navigates away from this page.
protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e)
        {
            //we're navigating away from this page, be sure to run this cleanup or you'll have issues
            _scanTimer.Stop();

            if (_phoneCamera != null)
            {
                // Cleanup
                _phoneCamera.Dispose();
                _phoneCamera.Initialized -= cam_Initialized;
                CameraButtons.ShutterKeyHalfPressed -= CameraButtons_ShutterKeyHalfPressed;
            }
        }

Step 13 - Specify Application Capabilities

With Windows Phone and Windows Store applications, it is mandatory that you specify what capabilities your application requires in order to be used within the Application Manifest File (WMAppManifest.xml). If this isn't set, your application will not be granted access to the device/sensor required, and will therefore keep crashing when attempting these unpermitted steps. For this application, we need to grant rights for the application to use the camera and, just to be safe, the photo library, as shown in the following.

Step 14 - Specify Application Requirements

Additionally, in the same file (WMAppManifest.xml), there is also a section for specifying the minimum requirements for the device running your app. In this case, we'll of courses require a camera, so you'll want to flag this as a requirement for your application as shown in the following.

Step 15 - Update Packaging with Capabilities for the Storefront

While not technically mandatory, it is considered good policy to update your application's packaging to ensure the Windows Store storefront page conveys your application requirements properly. This is done by updating the Package.appmanifest file within Visual Studio. For this simple application, I've marked that we're accessing the "webcam" and "pictures library" as they seem to be the best fit. This is also where you will want to version your application so that the package file automatically updates the storefront when you upload your package to the store.

Final - Compile and Run

If all the above is correct, you should be able to build and run your application. Since you'll be using the camera on a device, I'd recommend targeting your developer device (and not the emulator), so you can scan some web-generated QR Codes or other Bar Code Types. Any troubles, try downloading the sample application as a whole and running the sample package to see if you are missing any SDK's. The sample was built using the free Visual Studio 15 Community Edition with .NET and WindowsMobile 8 SDK's.