Skip to main content

Microsoft Silverlight

Answered Question How to add web site to existing SL2.0 Silverlight project?RSS Feed

(0)

TBink
TBink

Member

Member

254 points

188 Posts

How to add web site to existing SL2.0 Silverlight project?

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
sladapter

All-Star

All-Star

17439 points

3,172 Posts

Answered Question

Re: How to add web site to existing SL2.0 Silverlight project?

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.

 

sladapter
Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

TBink
TBink

Member

Member

254 points

188 Posts

Re: Re: How to add web site to existing SL2.0 Silverlight project?

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>

sladapter
sladapter

All-Star

All-Star

17439 points

3,172 Posts

Re: Re: How to add web site to existing SL2.0 Silverlight project?

Set your newly added Web Project as Startup project, and new SilverlightTestPage.html as your Start page. Try it again.

 

sladapter
Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

CraigN
CraigN

Member

Member

352 points

89 Posts

Re: Re: How to add web site to existing SL2.0 Silverlight project?

 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.

Microsoft Xbox MVP

sladapter
sladapter

All-Star

All-Star

17439 points

3,172 Posts

Re: Re: How to add web site to existing SL2.0 Silverlight project?

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.

 

sladapter
Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities