【发布时间】:2023-03-29 12:26:01
【问题描述】:
因为我想做一些事情,比如从网络加载图像(见post)。要查看实际情况,请尝试创建一个没有网站和有网站的 Silverlight 项目,然后将以下内容添加到主页中。在 web 项目中,事情按预期工作,在基于文件的项目中,您会得到一个白屏。
<Grid x:Name="LayoutRoot" Background="White">
<ListBox>
<ListBoxItem>
<Image Source="http://sstatic.net/so/img/logo.png"/>
</ListBoxItem>
<ListBoxItem>
<Image Source="http://sstatic.net/so/img/logo.png"/>
</ListBoxItem>
<ListBoxItem>
<Image Source="http://sstatic.net/so/img/logo.png"/>
</ListBoxItem>
<ListBoxItem>
<Image Source="http://sstatic.net/so/img/logo.png"/>
</ListBoxItem>
</ListBox>
</Grid>
所以我想我需要将我的 Silverlight 项目从使用默认文件移动到 http 可访问位置。如何将我的开发文件移动到网站,并且仍然能够从 Visual Studio 编译、调试等。这样做的唯一方法是创建一个新的解决方案作为 Web 项目并添加所有内容吗?
【问题讨论】:
-
如果您只使用网站来提供图片等静态内容,为什么使用主机 ASP.NET 网站进行调试很重要?
-
因为从文件运行 silverlight 时图像不显示。见stackoverflow.com/questions/1793487/…
标签: silverlight silverlight-4.0