我正在开发 WP 8/8.1 应用程序。我面临的问题是,当我使用“Adcontrol”工具时,它会在其下方显示一条蓝线,并出现以下错误。
Error 1 The name "AdControl" does not exist in the namespace "clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI". C:\Users\PraneetSah\Documents\app_3\AppStudio.UI\Views\MainPage.xaml 45 11 AppStudio.UI
Error 2 The type or namespace name 'Advertising' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) C:\Users\PraneetSah\Documents\app_3\AppStudio.UI\Views\MainPage.xaml.cs 5 17 AppStudio.UI
Warning 3 The referenced component 'Microsoft.Advertising.Mobile' could not be found. AppStudio.UI
Warning 4 The referenced component 'Microsoft.Advertising.Mobile.UI' could not be found. AppStudio.UI
Error 5 The type 'ads:AdControl' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\PraneetSah\Documents\app_3\AppStudio.UI\Views\MainPage.xaml 45 12 AppStudio.UI
就是这样;我的 SDK/Studios 都安装在默认位置,但我目前正在处理的项目不在默认位置,而是存在于 Documents{custom-folder\... 所以这可能是个问题?或者是其他东西?请帮帮我。以下是我正在使用的 adcontrol 代码(请注意它在下面显示蓝线 广告:广告控制”:
<ads:AdControl Width="480" Height="80"
ApplicationId="XXXXXX" AdUnitId="XXXXXX"
IsAutoCollapseEnabled="True"
IsAutoRefreshEnabled="True"
HorizontalAlignment="Center"/>
最佳答案
您需要将广告命名空间添加到 xaml。 Microsoft 示例源代码中应该涵盖了这一点,请查看它们。
关于c# - 广告在 WP 应用程序中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23391844/