views:

471

answers:

1

I'm working on a SQL Server 2008 Express + silverlight project, and so far things are working pretty well on the local machine. I've set it up to where the silverlight app connects to the SQL Server using a service reference and LINQ, and I believe the SQL Server allows remote connections with TCP/IP.

However, since the silverlight app is an .aspx file, it needs to run on a web server. When I click "run" in visual studio (2008), IE pops up with the address "http://localhost:1437/SQLTestTestPage.aspx", and everything works correctly. So that I can use this page remotely, I'd like to be able to access the same page by "http://10.215.22.57:1437/SQLTestTestPage.aspx", where 10.215.22.57 is the IP of the local machine. This doesn't work right now, and I'm not sure exactly how to enable it. Is this even possible through SQL Server, or do I need to set up a separate HTTP server to host the aspx page?

Thanks, -Robert

Edit: Actually, since I'm launching silverlight app from Visual Studio, I guess it's actually VS that is setting up the web server that hosts the .aspx page, not SQL server.

+2  A: 

Seems like a number of things could be going on here. To cut to the chase, your best bet is probably to move the Web project to IIS instead of the development web server, then try to point to it from the external IP. To do that, right click on the MySilverlightApp.Web project (ASP.NET Project that contains the .aspx page) and choose properties. Hit the Web tab, then under servers Choose "Use Local IIS Web Server" instead of "Use VS Dev Server." You should get a prompt asking you to create a virtual directory; choose Yes. Hit F5 to debug in VS and you should see your site with a new url - chance localhost to your IP and hopefully it will still work. The reason it doesn't work with the VS Dev Server is that the server goes away when you stop debugging in VS. Also, there are plenty of things that can go wrong here (IIS not installed, ASP.NET not registered in IIS, cross domain policy violations as well as other problems related to the SQL connection) so post your results!

James Cadd
I think you are exactly right in your diagnosis. However, I don't have IIS installed, so I can't actually test it working. Thanks so much for the detailed and helpful response!
JoeCool