开发者

Silverlight: TestPage.html is just a white screen

I have a Silverlight project. All of a sudden, when I build it and access TestPage.html, it is blank. The HTML hosting the SL object is stil开发者_如何学Cl there, but for some reason nothing loads. Why could this be?

I'm using Silverlight 4 with Visual Studio 2010 Ultimate.

Also, I'm getting this error on build sometimes:

Unknown build error, 'An item with the same key has already been added.'

I rebuild and it goes away.

A breakpoint in the home page's constructor is hit.

Update: I'm moving around in the source tree. I observe the problem on a revision, leave it, then re-update to that revision and the problem won't reproduce. ???

Update 2: It seems that every time I get the build error mentioned above, and then I rebuild it, the blank screen issue occurs.

Update 3: The problem appears to be correlated with when an image is added to the project. Interesting. Perhaps I need to look into the resources.resx file to see if there is a problem. I'm not sure how to do that.

Update 4: If I change that image's build action to "Content", it works fine. If I change it to "Resource", the problem occurs. I have no idea why it works this way.


You might have a problem in the initialization code of your Silverlight application. Try attaching the Visual Studio debugger to your browser process making sure that it's set to debug Silverlight and refresh the page. See if anything is thrown.

If not, try adding a breakpoint at the start point of your Silverlight application and see if it's even trying to be initialized.

If not, take a close look at your HTML page and make sure you're referencing the right location for your XAP file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜