Publishing WCF RIA Domain Services under IIS 7.0 and Silverlight 5.0 - wcf

I have some simple questions regarding the publishing of WCF RIA domain services under IIS 7.0:
1.) Do I need a *.svc file to publish a WCF RIA domain service under IIS 7.0? Yes/No?
2.) If 1.) is yes, is there any way to generate this *.svc file automatically or do I have to do it on my own manually? Automatically/Manually?
3.) My domain services are simple classes in *.cs files. Do I need to configure them "Always Copy into publishing folder" OR do the domain services "live" in the build "Web.dll"? Always Copy/Live in the Web.dll?
My questions seem simple, but I am having a real hard time to get this working under IIS 7.0. Debugging and testing in the internal VS 2010 development server is no problem.
I never had a problem to publish a "normal" WCF Service, because there are plenty of good advises out there, but for WCF RIA Services it's a pain in the ass to me.
Thanks in advance for your short answers. If you have any good link to a tutorial on publishing WCF RIA Services with Silverlight 5.0, pleaaase post it. I am working on this for days now and have googled my brain to death. I really don't understand that this is so hard. I have found some links here on SO, but some of them are already not existing anymore, some of them seem be useless, because the WCF RIA Services changed over the time.
Thank you and I really appreciate any help.
EDIT: I already can debug the WCF RIA Service code on IIS in VS 2010, but only if the service is called from a ASP.NET code behind file. That tells me, that the WCF RIA services are working and running on IIS. This question is all about publishing the services to outer world.

Did you try to publish the project from the visual studio ?
I found some interesting links to read:
http://msdn.microsoft.com/en-us/library/ff426912(v=vs.91).aspx
http://timheuer.com/blog/archive/2009/12/10/tips-to-deploy-ria-services-troubleshoot.aspx
http://social.msdn.microsoft.com/Forums/da-DK/wcf/thread/84b377b2-45d1-44d3-ba1a-7d9ef5ee939a
I hope this is helpful for you.

Related

browser keeps downloading .svc files WCF

Been doing this for hours now and it drives me nuts.
On windows 7 I installed IIS 7.5 through add windows features, also installed WCF HTTP activation, also did all the command line registrations.
In VS 2013 I have a WCF Services project that runes very fine when I run it in IIS express but I want to test it together with my front-end.
But when I browse to my .svc file in the browser it just keeps getting downloaded, been searching google but get wrong results all the time, hopefully! Someone can help me.
Greets
If your WCF Service is in .Net Framework 4.0/4.5, then check the .Net Framework version in Application Pool.
If it is 2.xxxxxx, change it to 4.xxxxx.

is there any way to add non silverlight assembly to a silverlight project?

I want to add non-silverlight assembly to a silverlight project,
is there any way to do this? or what will be the other option to do ?
As Andrey writes, it's impossible to add a non-Silverlight assembly to a Silverlight project. If you really need to use it, you have no option but to run it server-side. You may already have a Web project that goes with the Silverlight project, and if so, that's where you should add a reference to this assembly.
The technology used to make remote calls from Silverlight to the web project is WCF RIA Services. The page I linked to contains plenty of documentation and videos to help you learn about WCF RIA Services.
There are, however, a few situations in which this approach won't work. Perhaps none of them apply to your circumstances, but since you don't provide any details about this assembly, I can't be sure.
If, for example, your assembly contains some WPF controls and you want to add them to your Silverlight application, you're out of luck. You'll have to find Silverlight-specific equivalents.
If you'll be calling this assembly frequently, you might find your Silverlight application spending a lot of time waiting for the server to respond. This could slow your application down significantly.
If your application needs to be able to run out-of-the-browser and disconnected from the internet (a requirement of my current Silverlight project), you will also be out of luck.
There are a number of things that I can think of that should work reasonably well over WCF RIA Services:
sending email, calling web services or various other network-related activities,
talking to a database,
mathematical calculations.
It is impossible because Silverlight has different runtime from full .net framework. The common way to solve it is to create WCF service that will have access to that assembly and provide remote access for Silverlight application.

WCF - IIS vs Custom Hosts

I've been working with WCF fairly extensively for over two years now and have almost always taken the "lazy" route and deployed everything through IIS. Some of the reading I've done lately is starting to trend to where developers are using custom hosts in windows services or as console applications. Is there major benefits to switching over to that paradigm or is my current strategy of hosting everything in IIS give me everything I need to do WCF services?
When you go the self-hosting route, you limit the scalability & reliability options of your services. If scalability isn't a concern, you still need to consider all the service monitoring functionality that you'd have to create to be sure your services are running reliably.
If I had to pick two reasons to prefer IIS hosting over self-hosting they would be the flexibility of the WAS service instantiation model for IIS 7.x and the Windows Server AppFabric features for WCF 4.
If you're using a pre-WAS version of IIS (5 or 6), Windows services may be your best (only?) good bet for hosting WCF services that communicate via named pipes or netTCP (anything other than HTTP).
In the 3rd Edition of Programming WCF Services (link), Lowy suggests using Windows Server AppFabric in some situations, and suggests self hosting in a few cases - when you need to use the service bus and IIS 7.5 is not available, for example. Pages 22 and 23 show a couple of simple charts to help determine when to use self hosting over IIS, WAS or AppFabric. I think the first chapter (maybe more) is available for free if you get a Kindle sample.
Other than these scenarios, I'm not sure why you'd ever want to chose any sort of self-hosting over WAS. I'm curious to see if anyone presents good reasons.

WCF communication with a Silverlight application

I have previously built WPF apps that host their own WCF service running on a custom port. Which is a great simple way for other apps to send messages between each other.
I have recently inherited a Silverlight 4 app from a client and they would like a way to send messages to it. I figured that WCF would be a simple way, but it is not possible to host a service in Silverlight.
What is a good, simple, way to send messages/communicate with a Silvelight app?
I have seen a little about the LocalMessageSender but I have no experience with it, can a WPF app, running on a different machine send a message to a Silverlight application using the LocalMessageSender class?
(Polling from the Silverlight app is not a prefered option)
I dont mind having to run the app in out of browser mode to get around some issues if need be.
EDIT Updated question
You can add Silverlight enabled WCF services and communicate with them like you did in the WPF app.
just so you know, SL only supports basicHttpBinding and (new in SL4) netTcpBinding. The later is intended for Intranet scenarios. As tchrikch said, you should be able to reference your service just by adding a simple reference in Visual Studio. As for the communication part, this may prove to be a little difficult. I would suggest looking at HTML5 WebSockets and see if you can push messages to the client from the server that way. I've only recently started looking at this as a solution for one of our projects but haven't had time to look any deeper.
HTH
Steve

Manually configure WCF to use HTTP on Vista home premium

I'm trying to develop and deploy a WCF service using VS2008 and Vista home premium. I don't have IIS running and understand I don't need to if I manually configure the WCF app ... using netsh.exe I believe.
Can anyone give me clear guidance on how to go from the development project in VS2008 to a useable service?
Many thanks.
A WCF service needs a host to run. As IIS is out of the question you have a couple of possibilities left:
Write a Windows NT service and host it there
Write a managed application which will host your service (less robust)
As far as netsh.exe is concerned I don't see much relevance with WCF.