【发布时间】:2011-01-08 05:07:32
【问题描述】:
我有一个包含 ASP.Net 4 网站和 Silverlight 4 项目的 vs2010 解决方案。
该网站链接到 Silverlight 项目(“地图”),并且 ClientBin 文件夹包含一个 Map.xap 文件。
地图项目非常简单。它包含默认的 App.xaml 和 App.xaml.cs 文件。 MainPage.xaml 文件如下所示
<UserControl x:Class="Map.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="380" d:DesignWidth="800">
<Canvas x:Name="MainCanvas" Width="800" Height="380">
<Canvas.Background>
<ImageBrush ImageSource="map.png" Stretch="None"/>
</Canvas.Background>
</Canvas>
其背后的代码如下所示:
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
throw new Exception();
}
}
在其中一个网站页面中,我的默认对象指向我的 Silverlight xap
当我运行该网站时,我在 Silverlight 窗口的 Canvas 上看到了我的背景图像,所以我知道它在这个意义上是有效的。但是,我无法中断 MainPage.xaml.cs 文件(在 IE 中)中设置的任何断点。我已经检查了 Silverlight 调试的正确设置。
看到我在 MainPage 构造函数中抛出的异常了吗?我也没有看到。事实上,我放在那里的任何东西似乎都没有运行,但我知道 xaml 正在渲染,因为我可以看到我的画布背景。我在这里没有得到什么?
【问题讨论】:
标签: asp.net silverlight