开发者

Silverlight "Out of browser application" vs. "Install from page"

I’ve been working on integrating some controls which call in to COM classes in to a Silverlight client. Since my controls use COM, they only work out of browser. The client does have out of browser installation options turned on, and when I launch the client from visual studio, I can right click it, and install it to the desktop. That all seems to be working fine. The strange part though is that my controls don’t work when they’re out of browser – I get an error that the COM server can’t be started.

The stranger part is that if I go in to the clientproperties, and set the Start Actio开发者_JS百科n from “Dynamically generate a test page” to “Out of browser application”, my controls work fine, and I get no COM errors. So I guess I don’t understand the difference between installing the application to the desktop through the right click menu and setting the application to start as an out of browser application. Any idea what's going on here?

Edit

It looks like this may be related specifically to debugging. If (in Visual Studio) I choose Debug->Start Debugging, my COM code works. If I choose Debug->Start Without Debugging, it doesn't work. It also doesn't work if installed directly from the XAP file.


This turned out to be an elevation problem. The COM process I was trying to access was running elevated, and I was trying to launch the SL app elevated as well. However, the sllauncher.exe would start up elevated, and then immediately drop its elevated status, and become un-elevated. So we had a non-elevated process trying to talk to an elevated process, which of course would fail. Visual Studio was elevated, so launching the app from there kept it elevated, which is why it worked from there.

I resolved it by making sure the elevation matched on my two apps - not launching the COM process elevated.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜