none
Running XBAP application keeps on opening multiple pages of a browser

    Question

  • I have created an XBAP application. When I run it (by using F5) it keeps on opening multiple web pages. I want to open only one web page.

    Also, I have two browsers on my system. Currently it opens pages in Mozilla, I want to open my XBAP page in IE. How to do this? 

    Wednesday, June 27, 2012 3:27 PM

All replies

  • Hi WpfBee,

    For your first question, could you please show some code for repro the issue?

    For the second question, if you set IE as the default web browser, the pages will be open in IE.

    Have a nice day,


    Kee Poppy [MSFT]
    MSDN Community Support | Feedback to us

    Monday, July 02, 2012 5:56 AM
    Moderator
  • Hello Kee, I think my problem is not with code rather with my some settings.

    I remember when I created my 1st xbap test application, it opened only one IE page.

    Later, I think before running an xbap application some message pop up by application & I don't remember what was that and I clicked button on that message box. Since then even if I run any other xbap application on my machine, it keeps on opening muliple pages.

    I hope below code might help you to analyze the problem.

    Page1.cs:

    namespace Lab_CreatingAnXBAP

    {

    public partial class Page1 : Page

    {

    public Page1()

    {

    InitializeComponent();

    }

    private void button1_Click(object sender, RoutedEventArgs e)

    {

    System.IO.IsolatedStorage.IsolatedStorageFileStream fs =

    new System.IO.IsolatedStorage.IsolatedStorageFileStream("H:\\Lab_Xbap.txt", System.IO.FileMode.OpenOrCreate);

    System.IO.StreamWriter writer = new System.IO.StreamWriter(fs);

    writer.Write(textBox1.Text);

    writer.Close();

    }

    private void button2_Click(object sender, RoutedEventArgs e)

    {

    System.IO.IsolatedStorage.IsolatedStorageFileStream fs =

    new System.IO.IsolatedStorage.IsolatedStorageFileStream("H:\\Lab_Xbap.txt", System.IO.FileMode.Open);

    System.IO.StreamReader reader = new System.IO.StreamReader(fs);

    label1.Content = "Hello "+reader.Read();

    reader.Close();

    }

    }

    }

    App.xaml:

    <Application x:Class="Lab_CreatingAnXBAP.App"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    StartupUri="Page1.xaml">

    <Application.Resources>

    </Application.Resources>

    </Application>

    app.manifest:

    <?xml version="1.0" encoding="utf-8"?>

    <asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>

    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">

    <security>

    <applicationRequestMinimum>

    <defaultAssemblyRequest permissionSetReference="Custom" />

    <PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" />

    </applicationRequestMinimum>

    <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">

    <!-- UAC Manifest Options

    If you want to change the Windows User Account Control level replace the

    requestedExecutionLevel node with one of the following.

    <requestedExecutionLevel level="asInvoker" uiAccess="false" />

    <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

    <requestedExecutionLevel level="highestAvailable" uiAccess="false" />

    If you want to utilize File and Registry Virtualization for backward

    compatibility then delete the requestedExecutionLevel node.

    -->

    <requestedExecutionLevel level="asInvoker" uiAccess="false" />

    </requestedPrivileges>

    </security>

    </trustInfo>

    </asmv1:assembly>

    ============================

    Also, creating xbap application in VS2008 in stead of VS2010 also did not help. Same problem: opening multiple pages.

    My 2nd question: Can we do some setting so that on each xbap application run it asks to choose your browser?


    Vishal Kumar





    • Edited by WpfBee Tuesday, July 03, 2012 11:53 PM
    Tuesday, July 03, 2012 11:41 PM