Problems with making Silverlight project out of browser - silverlight

I have a task to make large Silverlight project run out of browser.
Fortunatelly I don't have to rewrite it to some other technology. Unfortunatelly I can not understand how to make it work OOB. I tried everything that's in guides :
enabling OOB option, installing and tryiung to debug installed app, but main thing is that when I run this app OOB I can't reach any services (no matter how I try HTML Bridge is disabled in OOB).
Is there a way to reach those services (like https://localhost/WCFRest/GetUserInfo?login=somelogin&password=somepassword) from OOB enviroment?
What should I do to reach them?
I'm sorry if this is noob quetion but I can't ask anyone else.

I assume you have a Web project in your solution. I think you changed the startup project to the silverlight project. You need to start up the Web project too.
Do the following:
Right click on the solution in the Solution Explorer and select Properties.
Select "Multiple startup projects" and set the action to "Start" (on the web project)
Or just simply right click on a HTML or ASPX file in the web project and select "View in Browser".

Related

WPF Clickonce in Firefox and Chrome

We have a WPF Clickonce application, whcih is deployed in Server. It is working perfectly in IE. The application started installing on single click. But in Firefox and Chrome, the file was downloaded. How to overcome this? I know there are some plug-ins which will allow this as IE.
But my question is, Can I add these plugins into my application pre-requisites? Or what is the good approach to do that. Is there anyway that I could install the plugins by detecting the browsers before starting the clickonce app? I don't want my end users to do that.
Even if you find a way to embed plugins into ClickOnce-bootstrapper ("pre-requisite") you'll have to tell user to run it explicitly. ClickOnce doesn't support installing of dependencies transparently. You'll have an .exe file which user need to run. Usually VS wizard generates an html page (publish.html) which has client code for detecting missing pre-requisites. But actually it detects only missing .NET.
So you have to write some js-code for detecting missing/installed extensions for each browser you want to support.
Check this SO question: Checking if user has a certain extension installed
In anyway if a user has a link to .application and opens it in the browser then all pre-requisites will be ignored. As actually ClickOnce itself doesn't have such a feature as "pre-requisites" or "dependencies". It's just a helper for generating totally separated setup.exe bootstrapper.
Here links for extensions:
Firefox addin for ClickOnce applications - https://addons.mozilla.org/en-US/firefox/addon/microsoft-net-framework-assist/
Google Chrome addin for ClickOnce applications - https://chrome.google.com/webstore/detail/eeifaoomkminpbeebjdmdojbhmagnncl

How to get out of browser to work on a silverlight application?

I have a silverlight application and i have already checked the box that enables OOB. When i run the program from the IDE and i right click on the browser, i do not get an option to install the application. Instead i have an option to remove the application.
I would like to get an icon that other users can just click on in order to run the application. Is there a reason why i do not have the option to install the application when i run my program?
If it matters i am using silverlight 5.
thanks!
You have the option to remove the application means you have installed out of browser in the past, after clicking "remove the application" you will have the option to install the application locally.

How to use a Silverlight Solution

I have a Silverlight app made in Visual Studio 2010 and I want to put it on a website but I don't have the slightest clue how.
I've looked at all the msdn documentation and they all mention a .xap file that is the file you use on the website but there is no .xap and I can't find out how to compile my code into a .xap file.
Also, when I run the App and look at the source in the browser, it has my code compiled into the .xap file, but there is no .xap file!
So my question is simply how do you go about getting a Silverlight app on a website because I've been trying for hours and I can't figure it out.
A sample html or aspx page is included when you create the solution. This is the page that the browser navigates to when you hit F5. You can take that page as a basic example of how to embed a Silverlight app in a page. You should find it in the project folder.
Silverlight projects are commonly built into a XAP file when you hit "Build" in VS. This file lives in the bin/Release or bin/Debug folder and basically contains your whole application.
Steps to create a silverlight application Hosted in a web site,
Select Silverlight Application Template while adding new project in VS2010
When you click Ok, ensure that Host the Silverlight application in a new web site is Checked.(It will create a new ASP.Net web application to host the Silverlight)
If you haven't checked the Host the Silverlight application in a new web site option, you can add a new ASP.Net Web application project and then go to its properties and select Silverlight Applications option in left pane. Then Click Add, select your Silverlight Application to be hosted and click ok. You are done now.
But If haven't selected the Silverlight Application Template, then you might have created a Silverlight Class Library. It wont generate any xap file. It just gives a dll. So you need to recreate a project as mentioned above.
I believe that in Silverlight whenever you create a project, right at the beginning, it will ask you if you want to create a web app automatically. If you chose yes, something like YOUR_PROJECT_NAME.web will be created, go into that folder, you will find a folder called ClientBin.
The .xap file will be inside that folder.
HTH

What if we don't host our silverlight Application when we first Create it?

As we all know very well..
whenever we create application inside silverlight it is asking us for hosting it
by dialogue box at given below.
My question is what if i unchecked the check box[Host the silverlight application in a new web site].
Means what kind of problem we have to face later if I don't host our Silverlight Application in any of the option given by dialogue box.
Basically it is not a problem at all. You can add a website at any time later.
In the project settings of a website there is a Silverlight tab. Under that you will find the option to add Silverlight projects to the website. This will setup the links to generate the XAP in ClientBin as well as giving you the option to create test pages for each Silverlight app added. The test pages will give you the sample JS you need to host your Xap later.
You will have to eventually host your application somewhere otherwise it will stay on your local harddrive and hardly reach any clients. So if you have an existing web site you could simply copy-paste the necessary javascript to this site later in order to embed your Silverlight application. In this case you can uncheck this checkbox.

Detach Silverlight 4 Out-of-Browser Window

I'm writing a Silverlight OOB application. Once the user has installed it, I would like the in-browser experience, on next visit, to just have a button to launch the OOB version. I know the API call to detect that it's installed, but I'm not sure to open my main Page control as or within a Window. Currently my in-browser view changes to say "Please launch from the installed shortcut" but that seems like it should be unnecessary. Is there a way to do this?
Thanks.
Unfortunately launching OOB app from the web page is not supported. This is commonly requested feature, but it looks like SL5 is not going to address it.

Resources