How to publish Silverlight 4 app using VS 2010?

Discussion in 'ASP.NET 4.0 RC Beta [Closed]' started by Polybius, Dec 9, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Today I was able to successfully use VS 2010 Beta2 to easily publish a small web app to my sandbox here at DASP. Very cool.

    http://community.discountasp.net/showthread.php?t=9118

    Silverlight
    Now, I want to use VS 2010 to publish a small Silverlight 4 app. Has anybody succeeded at that?

    ---

    I'm wondering if the server here at DASP hosting the sandboxes is set up for Silverlight?
    Here's a link:

    configuring-a-web-server-to-host-silverlight-content

    Is there a moderator here that can forward this question to the appropriate DiscountASP.net admin?

    Thanks very much.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Even though we have not tested, you should be able to bin deploy the silverlight dlls to the bin folder.

    as for the MIME settings, you should be able to do that using IIS manager.
     
  3. Bruce --
    Do we users have access to IIS Manager for sandbox accounts? How would I get to that?

    It seems to me that every developer who wants try Silverlight in your ASP.NET 4.0 sandbox will need to set the two new MIMEs.

    So if you could set the 2 MIMEs on the sandbox server, for the whole web server, then every Silverlight developer will benefit, won't have to stumble on this obstacle, maybe.

    configuring-a-web-server-to-host-silverlight-content

    Any thoughts?

    Thanks very much.

    PS. If I can successfully deploy a small Silverlight app to DiscountASP.net, I'll be sure to post a "How to" at the forum at Silverlight.net and give DASP a good word.
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    I just checked the server and confirmed that Win2k8 R2 already have these 2 MIME setup as default.

    yes. you should be able to connect to IIS manager.

    just use the same username / password.
     
  5. Bruce --

    Thanks for checking the server.

    Although I can successfully use VS 2010 and MSDeploy to Publish a web app, I'm unable to use it to Publish a Silverlight 4 app.

    Here's the error msg I get:

    Code:
    Error	VsMsdeploy failed.
    (Remote agent (URL https://netfx4lab.discountasp.net:8172/MsDeploy.axd:8172/msdeploy.axd?site=userXXX.netfx4lab.discountasp.net) 
    could not be contacted.
    Make sure the remote agent service is installed and started on the target computer.)
    Error detail:
    Remote agent (URL https://netfx4lab.discountasp.net:8172/MsDeploy.axd:8172/msdeploy.axd?site=userXXX.netfx4lab.discountasp.net)
    could not be contacted. 
    Make sure the remote agent service is installed and started on the target computer.
    An unsupported response was received. The response header 'MSDeploy.Response' was '' but 'v1' was expected.
    The remote server returned an error: (400) Bad Request.
    I'm stumped as to why I'm able to use MSDeploy to publish an ASP.NET 4 web app to the sandbox, but am unable to succeed when I try it for a Silverlight 4 app.

    Any thoughts or ideas from anybody will be appreciated.
     
  6. Wondering if anybody has been able to successfully publish a Silverlight application to their ASP.NET 4 sandbox here at DiscountASP.NET.

    Has anybody figured out how to do it?

    Thanks in advance.
     
  7. Aristotle --
    That worked, by golly. Many thanks.

    For those wishing to use VS 2010 Beta2 to publish a Silverlight app to their ASP.NET 4.0 sandbox at DiscountASP.NET, here is the technique I just used, with help from Aristotle:

    1. In VS 2010 I selected the web application in my Solution Explorer, then from the menu I chose Build/Publish.

    2. In the Publish Profile dialog I chose these settings:

    Publish Method: MSDeploy Publish
    Service Url: https://netfx4lab.discountasp.net
    Site/Application: userXXX.netfx4lab.discountasp.net
    CkBox - Mark as IIS application on destination: Unchecked
    CkBox - Do not delete extra files on destination: Unchecked

    Credential
    CkBox - Allow Untrusted Certificate: Checked
    User Name: userXXX
    Password: xxxxx
    CkBox - Save password: Checked

    In the Credential area I probably didn't need to enter my username and password, but I did.

    Anyway, this worked well, only took about 5 seconds for my little HelloWorld app. Love this Silverlight stuff.
     
  8. Nevermind, I got it! Thanks for all the help
    Steve
     
  9. Silverlight - Database Problem

    First, thank you. This thread has been tremendously helpful.

    Second, I'm getting an "error on page" presumably from a problem connecting to the sql database. I created a simple table in my sandbox database, set up the connection in a visual studio / silverlight application and am able to run everything fine in the development environment.

    However, once I publish the files using VS2010 publish, and I access the page, I get an "error on page" and there is no data in my table. I'm new to this, so any insight would certainly be appreciated. If it works when I debug, why wouldn't it work when I deploy? Thank you -
     
  10. finmath --

    For my simple application I didn't use a database.

    For you, I guess my first question would be is your database packaged inside your application, or do you have a separate database account at DiscountASP.NET?

    I guess my second thought would be to carefully check your connection string. It would probably have one value appropriate for your development machine situation, and another value appropriate for when your app is running at DASP.

    Good luck.
     
  11. Silverlight - Database Problem

    Polybius - thank you. These are the steps I followed using the free .net 4.0 sandbox account:

    1. Upload data to a new database table under my user account using login information given by DASP
    2. Start a new Silverlight 3.0 project in VS2010
    3. Drag in a datagrid (under silverlight controls)
    4. Added New Item -> LINQ to SQL Classes
    5. Use Server explorer to find DASP server and add the data connection
    6. Once it recognized the server and found the database, drag the table onto the design surface
    7. Added New Item -> Silverlight Enabled WCF Service
    8. Wrote some code, including LINQ to access data in the .svc.cs item
    9. Added the service reference to the solution
    10. Wrote code to display the table upon initialization of the page

    When I debug, it runs fine - displays the table with the data.

    11. Publish the XXX.Web using the MSDeploy login info from DASP.

    Page shows up, but says "Error on Page"

    I tweaked the Web.Config item to exactly what DASP sent:
    Data Source=netfx4lab.discountasp.net;Initial Catalog=DB_userXXXX;Password=XXX;Integrated Security=False;"

    Although it still ran fine in the debugger, it still doesn't work when I publish it.

    Any thoughts? I'm stumped -
     
  12. Update to Deploying Silverlight 4...Thx Polybius

    As an update to Polybius' excellent step-by-step publishing advice, I have some suggestions having recently tried it with VS 2010 RC and Silverlight 4 RC:

    1. The Publish Method: Originally called "MSDeploy Publish" is now called "Web Deploy."

    2. CkBox - "Do not delete extra files on destination" now says "leave extra files on destination (do not delete)"....you should now check it.

    (For some reason my Sandbox was having pemission issues, so by checking this I didn't have to worry about deleting directories, etc.)

    3. I would enter your username and password (and check save) because it prompts you for them anyway.

    Other than that, Polybius' nailed it exactly.

    My WCF services from my regular DiscountASP site...which then access another DiscountASP site (with the SQL Database) were easily accessed without issue.

    Thanks again, Polybius!

    Keith
     
  13. Keith --
    Thanks for the good update.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page