When i run my unity3d apps in visual studio for windows phone with google ads it's not working, because some exception happens: "Exception type System.UnauthorizedAccessException in System.Windows.ni.dll .. "Exception type System.UnauthorizedAccessException in Microsoft.Phone.Interop.ni.dll "Exception type System.Reflection.TargetInvocationException in mscorlib.ni.dll "Exception type System.IO.FileNotFoundException in mscorlib.ni.dll "Exception type MS.Internal.NativeParseException in System.Windows.ni.dll MainPage.xaml.cs var bridge = new UnityBridge(); Grid ContentPanel; UnityApp.SetBridge(bridge); InitializeComponent(); // NOTE: Edit "MY_AD_UNIT_ID" with your ad unit id. AdView bannerAd = new AdView { Format = AdFormats.Banner, AdUnitID = "ca-app-pub-xxxxx/xxxx" }; bannerAd.ReceivedAd += OnAdReceived; bannerAd.FailedToReceiveAd += OnFailedToReceiveAd; ContentL.Children.Add(bannerAd); AdRequest adRequest = new AdRequest(); adRequest.ForceTesting = false; bannerAd.LoadAd(adRequest); bridge.Control = DrawingSurfaceBackground; MainPage.xaml is <DrawingSurfaceBackgroundGrid x:Name="DrawingSurfaceBackground" Loaded="DrawingSurfaceBackground_Loaded"> <GoogleAds:AdView HorizontalAlignment="Left" Margin="27,688,0,0" VerticalAlignment="Top"/> <GoogleAds:AdView HorizontalAlignment="Left" Margin="48,542,0,0" VerticalAlignment="Top"/> <Grid Name="ContentL" /> </DrawingSurfaceBackgroundGrid> What code are needs in MainPage.xaml? or some other features?
Maybe you're missing some capabilities in Package.appxmanifest, I would imagine ads need Internet Client capabilities enabled. Also, enable excpetions via Debug->Exceptions, so VS would stop at the exception, and you can inspect it.