none
how do I host wpf browser application in IIS RRS feed

  • Question

  • I would like to host several WPF browser applications in IIS, and include these as iframe in one IIS .net webforms application.

    Would you please provide the procedures involved in the first step: creating a wpf application in visual studio 2010 for hosting in IIS 7.

    I understand I need an xbap, but how do I get an xbap from the browser application project? I'm not seeing this in the folder after build.

    Also would you please confirm whether it is possible to run multiple xbap iis websites (using bindings possibly?), and present these though regular webforms website in multiple iframe?

    Tuesday, August 17, 2010 6:04 AM

Answers

  • Hi Jeff Leese,

    If you create a WPF Browser Application in Visual Studio by the Project Template, it will create a default page XAML file in the project. And you build the project, it will be compiled as a XBAP file in the Debug folder (in Relase mode, it compiled in the Release folder). Well, you chould refer to the document WPF XAML Browser Applications Overview to know about the development the XBAP in a hosted page and publish them with IIS.

    I understand I need an xbap, but how do I get an xbap from the browser application project? I'm not seeing this in the folder after build.

    Could you please try to check if you selected a "WPF Browser Application" project and have coded a page.xaml in your project? I think you may create this kind of project in your solution and set it as the StartUp project and build again.

    Also would you please confirm whether it is possible to run multiple xbap iis websites (using bindings possibly?), and present these though regular webforms website in multiple iframe?

    Yes, you could run multiple xbaps IIS website, but the DataBinding can not cross the website domain. The DataBinding is provided between CLR object in one site domain. If you would like to know the remote technic in .Net. You could sraech these keys: Remote .NET Object, WCF

    Sincerely,

    Bob Bao

    MSDN Subscriber Support in Forum 

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Wednesday, August 18, 2010 4:27 AM
    Moderator

All replies

  • Hi Jeff Leese,

    If you create a WPF Browser Application in Visual Studio by the Project Template, it will create a default page XAML file in the project. And you build the project, it will be compiled as a XBAP file in the Debug folder (in Relase mode, it compiled in the Release folder). Well, you chould refer to the document WPF XAML Browser Applications Overview to know about the development the XBAP in a hosted page and publish them with IIS.

    I understand I need an xbap, but how do I get an xbap from the browser application project? I'm not seeing this in the folder after build.

    Could you please try to check if you selected a "WPF Browser Application" project and have coded a page.xaml in your project? I think you may create this kind of project in your solution and set it as the StartUp project and build again.

    Also would you please confirm whether it is possible to run multiple xbap iis websites (using bindings possibly?), and present these though regular webforms website in multiple iframe?

    Yes, you could run multiple xbaps IIS website, but the DataBinding can not cross the website domain. The DataBinding is provided between CLR object in one site domain. If you would like to know the remote technic in .Net. You could sraech these keys: Remote .NET Object, WCF

    Sincerely,

    Bob Bao

    MSDN Subscriber Support in Forum 

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Wednesday, August 18, 2010 4:27 AM
    Moderator
  • Thanks for the suggestions. Once I selected a browser application project, built it, and copied the debug files to another project where i included the xbap files in an iframe, I was able to see the xbap.

    However, it includes the forward and back buttons above the iframe. Is it possible to remove this? I then tried using an xbap application, but I couldn't use it.

     

    Monday, August 23, 2010 5:01 AM
  • Hi Jeff Leese,

    You could set the Page.ShowsNavigationUI property to "False" to hide the "forward and back buttons".

    Sincerely,

    Bob Bao


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Monday, August 23, 2010 5:26 AM
    Moderator
  • How about your problem? If you need help, please feel free to let me know.

    Sincerely,

    Bob Bao


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Thursday, August 26, 2010 11:46 AM
    Moderator
  • thanks for the suggestion. It's not working yet. I still see the navigation buttons in the webforms page that has the iframe to load the xbap.

    For simplicity I have one web browser application, and in the code behind for the xbap page1 I have included the line you suggested. After building, I copy the files from the debug folder, to another webforms project where I display it, using this line.

     

     

    <iframe src="Debug/browserxbap.xbap" height="400" width="100%" >

    Because the navigation buttons were still there, I began to troubleshoot and I discovered that the webforms application is not updating when I replace the files from the xbap project. For example in the original xbap project it just had a button called xbap. Then I set ShowsNavigationUI = false and I changed the button to xbap2. I built the project, and copied all four files from the debug folder, to another folder within the webforms application. But when I run it, I still see the button called xbap, not xbap2. So it isn't updating.

    Could the old button be stored somewhere? How can I make it refresh?

     

    Monday, August 30, 2010 5:38 AM
  • Hi Jeff,

    Did you debug to run the XBAP project with ShowsNavigationUI = false, are the Forward/Backward button there? Since debugging the XBAP application, system will try to use the Visual Studio cache to view the content, not the ClickOnce chache, so you could see the updated content that the buttons has been removed. And after copying the files to the WebForms project, the web page references the XBAP page. We view the content via the ClickOnce cache, so you may see the old content of the XBAP.

    The method to clean the cache of the ClickOnce is run below command:

    Open the command prompt from Start > Visual Studio 2008 (or Visual Studio 2010) > Visual Studio 2008 Command Prompt (or Visual Studio Command Prompt (2010))

    command:  mage -ClearApplicationCache or mega -cc

    Sincerely,

    Bob Bao

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Monday, August 30, 2010 7:01 AM
    Moderator
  • Thanks Bob, that did it, and problem is solved.

    However, I had to fiddle with the command.

    mage -cc worked.  (Note the previous typo as mega)

    mage -ClearApplicationCache gave the reply "The first argument must be one of the following: -New, -Update, -Sign"

    As a last little bit of learning, I notice that the WPF browser application doesn't have a smooth connection to my Visual Studio Webforms project, because I have to drop out of the WPF project to copy over the files with file explorer. Is there a more elegant way to do this? Could I somehow work on the WPF parts, and have the webforms project automatically update from the new xbap? Are there any best practices published anywhere that details how to work with the two types of web projects simultaneously?

     

     

    Tuesday, August 31, 2010 12:46 AM
  • Hi Jeff,

    Thank you for your reply!

    For the details about the commands, please refer to this document: http://msdn.microsoft.com/en-us/library/acz3y3te(VS.80).aspx

    Unfortunately, there is no a good solution to integrate these two kinds of project in one solution. We have to copy then manually. But a suggestion may help you: you could create some test Html page in the WPF Browser Application project to test the XBAP first, and then copy them to the ASP.Net output folder. A similar issue discussed on the Stackoverflow : http://stackoverflow.com/questions/1592059/integrating-xbap-into-asp-net-web-application-continuous-integration-server-and

    Sincerely,

    Bob Bao

    --------------------------------------------

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Tuesday, August 31, 2010 2:07 AM
    Moderator