开发者

How run a silverlight application in another PC out of VS2010 with IIS

I created a silverlight application with .net framework 4.0. I'm using a WCF with Linq to SQL for calling stored procedures from SQL server 2008.

My applic开发者_开发问答ation works well in VS 2010 in local way but how can I install my application in another pc using IIS? I configured my WCF service in the other PC in IIS and work well the service but the application is not calling well.

The service doesnt show any errors and any data. My question is how my application can use that service or how can I install my silverlight application in another PC out of VS2010?

I try to use IIS in the client pc for install my silverlight application my WCF is run with any problems in client pc but the application doesn't show any data.


In my own opinion you have to disable the firewall of the machine you are going to connect.


Here's my guess:

When you add a reference to a web service in a Silverlight (version 3 and 4 at least) it creates a .clientconfig file. This file is similar to an app.config or web.config files you may already be familiar with. In it will be a hardcoded URI to the web service at the time you added the initial reference. My guess is that this path is still pointing to your dev machine. One option would be to change this URI to match the deployed location. I think the idea is that you'd unzip the XAP file, manually change the address, and re-zip (when you deploy/install the system).

You can alternatively programatically choose a different URI than the one in clientconfig. You pass a Uri object (or something like that) in the constructor of the generated service proxy class. I've often create a Uri this way that is relative to the path of the page the Silverlight app is hosted in. This makes deploying easy. But this relative path thing can make debugging difficult, you may want to consider a way to override this behavior. (we use a aspx code to alter the tag to include a named parameter to override the relative path thing)


Here are few possibilities:

-It may be related to Silverlight client access policy, just make sure that you can do cross-domain calls to the host that hosts the SL if you are calling from a different domain.

-Your references may not have been updated, still pointing to old addresses (like an IP maybe)

-Your IIS dev server gets a dynamic port and it has changed and the server doesn't run on the port that was specified in service definition anymore.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜