Register your app
Submit its Microsoft Store identity or signed EXE/MSI in the developer dashboard and wait for approval.
WinMonetize provides a native control for every supported Windows UI framework. Pick the package that matches your app, initialize it once, and place one banner control.
Submit its Microsoft Store identity or signed EXE/MSI in the developer dashboard and wait for approval.
Copy the numeric ad unit ID and your wm_… API key from the dashboard.
Follow your framework guide below with sandbox mode enabled, then complete the production checklist.
BannerAdView. Do not put your API key in XAML.Download the current SDK from Developer dashboard → SDK & API. Add the extracted package directory as a NuGet source, then install exactly one UI package. Its shared Core dependency is installed automatically.
| App type | NuGet package | Supported target |
|---|---|---|
| Windows Forms | WinMonetize.SDK.WinForms | .NET Framework 4.6.2–4.8.1 or .NET 8+ for Windows |
| WPF | WinMonetize.SDK.Wpf | .NET Framework 4.6.2–4.8.1 or .NET 8+ for Windows |
| WinUI 3 | WinMonetize.SDK.WinUI | Windows App SDK on .NET 8+ |
| UWP | WinMonetize.SDK.Uwp | Windows 10 version 1809 (build 17763) or later |
Using Visual Studio: open Manage NuGet Packages, add the extracted folder under Package Sources, select it, and install the package named above. Do not add a .nupkg file as an assembly reference. Then use following example command in Package Manager Console.
Install-Package WinMonetize.SDK.Wpf -Version 0.x.x -ProjectName TestProject
WinMonetize.SDK.WinForms.Program.cs:WinMonetize.SDK.WinMonetize.Initialize("wm_your_api_key");
WinMonetize.SDK.WinMonetize.EnableLog = true;
WinMonetize.SDK.WinMonetize.SandboxMode = true;
Application.Run(new MainForm());
3. Add the banner in the designer or create it in your form:
using WinMonetize.SDK.Controls;
using WinMonetize.SDK.Models;
var banner = new BannerAdView
{
AdUnitId = 58310427,
AdSize = BannerSize.Leaderboard,
RefreshIntervalSeconds = 45
};
Controls.Add(banner);
WinMonetize.SDK.Wpf. NuGet selects the correct .NET Framework or modern .NET asset.App.xaml.cs:protected override void OnStartup(StartupEventArgs e)
{
WinMonetize.SDK.WinMonetize.Initialize("wm_your_api_key");
WinMonetize.SDK.WinMonetize.EnableLog = true;
WinMonetize.SDK.WinMonetize.SandboxMode = true;
base.OnStartup(e);
}
3. Add the namespace and banner to your window or page:
<Window
xmlns:wm="clr-namespace:WinMonetize.SDK.Controls;assembly=WinMonetize.SDK.Wpf">
<wm:BannerAdView
x:Name="Banner"
AdUnitId="58310427"
AdSize="Leaderboard"
RefreshIntervalSeconds="45" />
</Window>
WinMonetize.SDK.WinUI.App.xaml.cs:protected override void OnLaunched(LaunchActivatedEventArgs args)
{
WinMonetize.SDK.WinMonetize.Initialize("wm_your_api_key");
WinMonetize.SDK.WinMonetize.EnableLog = true;
WinMonetize.SDK.WinMonetize.SandboxMode = true;
_window = new MainWindow();
_window.Activate();
}
3. Add the namespace and banner to your XAML:
<Window
xmlns:wm="using:WinMonetize.SDK.Controls">
<wm:BannerAdView
x:Name="Banner"
AdUnitId="58310427"
AdSize="Leaderboard"
RefreshIntervalSeconds="45" />
</Window>
WinMonetize.SDK.Uwp.App.xaml.cs:protected override void OnLaunched(LaunchActivatedEventArgs e)
{
WinMonetize.SDK.WinMonetize.Initialize("wm_your_api_key");
WinMonetize.SDK.WinMonetize.EnableLog = true;
WinMonetize.SDK.WinMonetize.SandboxMode = true;
// Create the root Frame and navigate to your first page here.
}
3. Add the namespace and banner to your page:
<Page
xmlns:wm="using:WinMonetize.SDK.Controls">
<wm:BannerAdView
x:Name="Banner"
AdUnitId="58310427"
AdSize="Leaderboard"
RefreshIntervalSeconds="45" />
</Page>
All four controls expose the same lifecycle events and manual load method. Add the event names in XAML or subscribe in C#.
<wm:BannerAdView
x:Name="Banner"
AdUnitId="58310427"
AdLoaded="Banner_AdLoaded"
AdFailed="Banner_AdFailed"
AdClicked="Banner_AdClicked" />
using System.Diagnostics;
using WinMonetize.SDK.Models;
private void Banner_AdFailed(object? sender, AdFailedEventArgs e)
{
Debug.WriteLine($"{e.Code}: {e.Message}");
}
// For a user-initiated refresh:
await Banner.LoadAdAsync();
The control loads when it enters the visual tree and refreshes automatically. The minimum refresh interval is 30 seconds; lower values are clamped to 30.
| Member | Purpose |
|---|---|
WinMonetize.Initialize(apiKey) | Sets the API key. Call once before any banner loads. |
WinMonetize.SandboxMode | Loads generated test creative and prevents billing/reporting. |
WinMonetize.EnableLog | Shows detailed diagnostics only while sandbox mode is also enabled. |
AdUnitId | Public numeric ID copied from your developer dashboard. New ad units receive random eight-digit IDs; existing IDs remain valid. |
AdSize | MobileBanner (320×50), Leaderboard (728×90), or MediumRectangle (300×250). |
RefreshIntervalSeconds | Automatic refresh floor; defaults to 45 seconds and cannot be less than 30. GIF/video rotations extend to finish a whole playback cycle. |
LoadAdAsync() | Requests a new ad immediately. |
AdLoaded | Provides RequestId and IsSandbox. |
AdFailed | Provides Code, Message, and the optional underlying exception. |
AdClicked | Provides the request ID and opened destination. |
SandboxMode = true.EnableLog = true for visible error details.SandboxMode = false.