Skip to main content
Home Forums Silverlight Programming Programming with .NET - General How to add web site to existing SL2.0 Silverlight project?
5 replies. Latest Post by sladapter on June 6, 2008.
(0)
TBink
Member
254 points
188 Posts
06-06-2008 4:36 PM |
I started my project as a simple Silverlight2.0 application when I created the project in VS2008. Now I find that I want to ADD a Silverlight compatible web site (as if I had originally chosen to create a "silverlight website" which combines the web site and application in one solution).
Can I do that easily? How? I know there are some linkages created that are essential for accessing web services created on the parallel web site (and accessing web my own web services is the reason that I want to create the parallel/associated web site).
Thank you for your help
Tom
sladapter
All-Star
17441 points
3,172 Posts
06-06-2008 4:43 PM |
Yes, Just add a new Web Project in the same solution. Then on the new Web Project add Silverlight link. Right Click the Web project you should see Add Silverlight Link option.
06-06-2008 5:28 PM |
I think I solved my own problem. I was still set to use the Default.aspx as the start page... I switch it to "My_Silverlight_Testpage.aspx" ... and it now things run correctly... (except that some of the content files (images and video) are not being found... gotta sort that out next).
Thanks again for your help... I leave the rest of my original note in for the reference of others who might have run into the same situation.
-------------------
Thank you,... that does add the website and create Silverlight test pages, a ClientBin with a 'myproject.xap' in it...
But, new problem. I compile/run the project (F5) and I get the message "This Silverlight project you are about to debug is consuming web services. Calls to the web service will fail unless the project is executed in the content of the web which contains the web service"
I don't yet have any web services installed (though I plan to). Is this because my Silverlight project is still the startup project?
The BIG problem is that when I switch the web site project to be the Startup Project... I get a blank page loaded in the browser. I'm guessing that the wrong file is being loaded/created...
Anyone know what I'm doing wrong?... I'm very new to this side of things
Here's the source html for the blank page that is loaded when I run my project
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title> Untitled Page</title></head><body> <form name="form1" method="post" action="default.aspx" id="form1"><div><input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNzgzNDMwNTMzZGTw+Y3pZm9y04OA7qIS6ow7Zh5+Vg==" /></div>
<div> </div> </form></body></html>
06-06-2008 5:31 PM |
Set your newly added Web Project as Startup project, and new SilverlightTestPage.html as your Start page. Try it again.
CraigN
352 points
89 Posts
06-06-2008 5:32 PM |
Its a blank page because the new web site has a default startup page set to default.aspx. Simply select the test page that was generated for you, right click and select it as the start page.
06-06-2008 5:34 PM |
There is a default.aspx page get generate in the Web Project, if you did not set Start Page the default.aspx probably get loaded instead of the Sivlerlight Test page. You can delete the default.aspx since it is not used.