Set default browser when debugging WPF? - wpf

I'm using VWD Express 2008 to develop a WPF Browser Application. When I start debugging, it launches the XBAP in my default browser, which is Opera. Obviously, XBAPs don't work in Opera, so I have to repeatedly right-click on the document to open in IE.
Is there any way to change the settings for PresentationHost.exe so that it always opens with IE? A registry setting, perhaps?

Setup the external program as Internet explorer path and the command line arguments as your path to xbap file within quotes, like shown below:

A simple and easy way to do this is to associate *.htm or *.html (don't remember exactly, try both) files with IE, and it will work for XBAP.
UPDATE:
Solution described above works for "Start external program option".
For "Start browser with URL" option you actually can set default browser in Visual Studio. I don't find how to set it through Tools -> Options, but you can achieve it by following steps:
In your solution explorer find a file which meant to be viewed in browser (e.g. *.htm, *.svc)
Right click on this item and choose "Browse With..."
In the opened window you'll see a list box with installed browser and one of them will be marked as default.
In the list box Choose "Internet Explorer" and click "Set as Default" (if there is no IE browser in the list just add it).

Set Default browser to IE for WPF:
Project preporties -> Debug tab properties...
Remove "-debug" only, if there in Command line arguments:(under Start Options)
Choose Start external program ( under Start Action) and give the path of "iexplore.exe"
(EX: C:\Program Files\Internet Explorer\iexplore.exe )

XBAP does work in Opera (and I can make a screenshot to prove the point). Consider updating your Opera version and/or .NET (do you have SP1?).

Check out this post on the msdn forums.
The workaround I found works OK, but requires that Firefox be your default browser:
In Firefox, open the menu Tools / Options / Downloads.
Then click on "View & edit actions" and change the action for XBAP applications to the Windows Presentation Host.
Now when I debug, Firefox receives the XBAP, but then it automatically pass it to the presentation host, which runs into IE. A bit cumbersome, because everytime a new tab gets opened in Firefox, but it's OK. It also works with F5, so you can debug.
Alternatively, you can start IE, navigate to the XBAP URL and then manually attach the debugger to the PresentationHost process (not to IE though).

Related

XBAP Support in IE Edge

I was building an WPF Browser application as such it requires many client specific functionality.
During debugging when i tried to run this application in IE Edge it starts behaving in buggy way i.e. it keeps downloading XBAP file in recursion again & again but when I saw the folder it does not contain any XBAP file.
My application works perfectly fine in IE11, I am not sure if Microsoft have removed the support of XBAP from IE Edge ????
I am wishing to have it cross browser application, any guidance / help would be much appreciated.
Thanks & Regards,
Srujal Kachhela
Edge does not support XBAP, and never will.
(I work on Edge)
Chronium based Edge supports XBAP
you need
msedge.admx in C:\Windows\PolicyDefinitions
msedge.adml in C:\Windows\PolicyDefinitions\en-US
run gpedit.msc and navigate to "Microsoft Edge"
"Configure Internet Explorer integration" --> Activate --> Option: "Internet Explorer mode"
"Configure the Enterprise Mode Site List" --> Activate --> Option: point to a xml file like "file:///C:/EdgeSites.xml"
EdgeSites.xml
<site-list version="3">
<created-by>
<tool>EMIESiteListManager</tool>
<version>10.0.14357.1004</version>
<date-created>01/08/2020 14:09:07</date-created>
</created-by>
<site url="myurl.com/site1">
<open-in>IE11</open-in>
</site>
</site-list>
you can enable IE mode on Microsoft Edge (Chronium based)
Go to Edge browser settings and click on Default browser
Under the “Internet Explorer compatibility” section, turn on the “Allow sites to be reloaded in Internet Explorer mode” toggle switch
Click the Restart button.
Add your site to Internet Explorer mode pages
add your site to trusted sites : Control panel->Internet options -> Security tab -> select "Trusted site" and click on "Sites"

Deploying Silverlight Application on IIS7

We have a silverlight application written in Visual Studio (VS) 2010 and we want to deploy it on a Windows Server 2008 R2 box (IIS7). To deploy it in VS I did a right click on the MyProject.Web project, selected "Publish...", from the "Publish method" I selected "File System". I copied the folder over to "C:\inetpub\wwwroot" on the server. In IIS Manager I did a right click on the folder, selected "Convert to Application", a window popped up, where you can select the application pool. I selected the default (.NET 4), I clicked on "Test Settings..." it failed (that was a bad sign), clicked ok.
When I try to access the website from a browser a message box pops up saying do you want to open or save "MySilverlightApp"?
Basically, it wants to download the xap file like it would download a text file or a doc file, it doesn't "run" it.
I have checked the forums and most cases the issue is that the MIME file types are not set up, but I have checked that it's all looks good, and it should as well because on IIS7 it's all set up by default so I am puzzled a bit here.
Thanks for your help.
I have just realized that you tried something about mime types so I need to edit my answer. I want to share a link to provide you a guide. It may be helpful to see if you miss a point.
http://www.iis.net/learn/web-hosting/web-server-for-shared-hosting/configuring-iis-for-silverlight-applications
The route cause of the issue was that the XAP file (inside the ClientBin folder) was the default document.
When I set the aspx file (in the application root folder) as the default document, it started to work fine.

Cannot debug Silverlight application running through VS 2010

I have an start up page called Default.aspx . Have written an javscript function inside the Head tag which opens an other aspx page and closes this page . The other aspx page of mine has silverlight object/ content render on that page . Due to this my debugger doesnt gets attached to the running silverlight application , also when i go to manually attach to the running Silverlight Application it doesnt works , i saw that type of process shown is script / silverlight / x86.
I am doing this all as my login page is only created in silverlight .
Any one have idea how can i get debugger atached.
Edit :
Below link explains the same what i am facing :
Visual Studio Attach to Process - change default automatic code type (Silverlight instead of Script)
To enable Silverlight debugging:
Right click on the Web project hosting the Silverlight application in Solution Explorer
Select "Properties"
Click the "Web" tab
Check the "Silverlight" box in the "Debuggers" section
I had problems debugging Silverlight in Chrome, while in IE it worked like a charm
A very nice utility is the WoVS Default Browser Switcher which can be installed using the Extension Manager (Tools | Extension Manager...)
This tool allows you to set the default browser to be used when debugging your project. In my experience Visual Studio only connects well to IE.
Using the tool I can keep another browser as my default browser but use IE for debugging.
Just use IE as default browser.
It doesn't work properly until you check silver-light debug checkbox and use IE as the others told.
By the way set web application as start-up project.

Watin File Download Problem

When I clicked button with mouse, File Download Dialog opens directly. But when Watin Button Click methods click the vert same button on same ie window this message appears and wait my confirm
To help protect your security,
Internet Explorer blocked this site
from downloading files to your
computer. Click here for options.
I turned off the Information bar for file downloads,(Internet Options-Security-Custom Level-Downloads-Automatic prompting for file downloads-->Enable),allow active x content, lower security level for internet etc.. but didn't work.
I'm using Win 7, IE8.
I had the same problem and found the solution : there is a bug in Internet Explorer 8 : settings for information bar file downloads are inversed.
It says "prompt for file download" but when you set it to "disable", it prompts; and when you set it to "enable" it doesn't !
So, the solution is : go to [Internet Options|Security|Custom Level|Downloads|Ask confirmation for fiel downloads] and set it to "Enable"
Also, try MouseDown() instead of Click().. it might act differently
Try adding your domain to trusted ones. This is in Internet Options. Unfortunately I don't have english version of Windows to point you directly to those settings.

How can I change IE's homepage without opening IE?

Here's an interesting problem. On a recently installed Server 2008 64bit I opened IE and through the Tools -> Options I changed the homepage to iGoogle.com. Clicked okay and then clicked the homepage button. IE crashes.
Now you'd think that I could just remove iGoogle as the homepage but when I open IE it immediately goes to that page and crashes on open.
Obviously I'd prefer to find a solution to why IE is crashing on the iGoogle page but just to get IE running again I need to remove iGoogle as the homepage. Is there anyway to do this without opening IE?
Control Panel -> Internet Options
Looking at the registry, the start page seems to be stored in
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Start Page
You could do it through the control panel, but you could also supply a url as a parameter to iexplore.exe.
start » run » iexplore about:blank
Two ways:
Control Panel->Internet Options
Start->Run... "%windir%\system32\inetcpl.cpl"
Not sure about IE7 on Windows Server 2008, but for IE6 the start page is stored in a registry key "Start Page" in HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main.
The answer is posted, but here's how you can discover the answer without having to ask 1: Set the homepage to something random ie FindMeKeyForURL.com
2: Search the registry for it
3: Extract it out and modify it, now you can deploy the .reg file

Resources