Silverlight 2104 Error w/ MVC project as Host

点点圈 提交于 2019-12-12 05:48:45

问题


I have a really odd 2104 error occurring when I am hosting a Silverlight control in my MVC site.

If I go to http://mywebsite.com/SomeController then the Silverlight application will load correctly. However, if I go to http://mywebsite.com/SomeController/Index then it fails to load and I get the 2104 error. I tried to change the Action name to something other than index, but still no luck.

Right now, it's just boilerplate Silverlight control code, but I need to add some initParams to it, so I need my action to look like http://mywebsite.com/SomeController/Index/1/2

Does anyone have any ideas on what could be causing this?


回答1:


Code 2104 is "Could not download the Silverlight application. Check web server settings". List of codes are here.

You are likely using a relative URL for your silverlight object, which doesn't resolve correctly if you are in a subdirectory.

Use the tilde syntax to correctly point to your silverlight object:

<param name="source" value="<% = Url.Content("~/ClientBin/MySilverlightThing.xap") %>"/>


来源:https://stackoverflow.com/questions/4336419/silverlight-2104-error-w-mvc-project-as-host

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!