1 |
An exception of type 'Microsoft.Advertising.Shared.AdException' occurred in Microsoft.Advertising.Mobile.DLL and wasn't handled before a managed/native boundary |
1 2 3 4 5 6 7 8 |
... adControl.ErrorOccurred += AdUnit_ErrorOccurred; } void AdUnit_ErrorOccurred(object sender, Microsoft.Advertising.AdErrorEventArgs e) { System.Diagnostics.Debug.WriteLine("ad error "+e.Error.Message.ToString()); } |
1 |
ad error Required capabilities are missing from manifest (WMAppManifest.xml): ID_CAP_IDENTITY_DEVICE,ID_CAP_MEDIALIB. |
- ID_CAP_IDENTITY_DEVICE
- ID_CAP_IDENTITY_USER
- ID_CAP_MEDIALIB_AUDIO
- ID_CAP_MEDIALIB_PHOTO
- ID_CAP_MEDIALIB_PLAYBACK
- ID_CAP_NETWORKING
- ID_CAP_PHONEDIALER
- ID_CAP_WEBBROWSERCOMPONENT
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Navigation; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using wp_ads.Resources; using Microsoft.Advertising.Mobile.UI; namespace wp_ads { public partial class MainPage : PhoneApplicationPage { private const string APPLICATION_ID = "test_client"; private const string AD_UNIT_ID = "Image480_80"; AdControl adControl; Grid grid; public MainPage() { InitializeComponent(); grid = (Grid)this.LayoutRoot.Children[1]; adControl = new AdControl(APPLICATION_ID, AD_UNIT_ID, true); adControl.Width = 480; adControl.Height = 80; adControl.ErrorOccurred += AdUnit_ErrorOccurred; grid.Children.Add(adControl); } void AdUnit_ErrorOccurred(object sender, Microsoft.Advertising.AdErrorEventArgs e) { System.Diagnostics.Debug.WriteLine("ad error "+e.Error.Message.ToString()); } } } |