OpenRIAServices / OpenRiaServices

The Open RIA Services project continues what was previously known as WCF RIA Services.
https://openriaservices.gitbook.io/openriaservices/
Apache License 2.0
54 stars 48 forks source link

[Discussion] How to install Domain Service Wizard support package? #149

Closed BatteryMan closed 5 years ago

BatteryMan commented 5 years ago

I am using the Open RIA Services Tooling and Templates For Visual Studio 2015 and following along the instructions from Walkthrough: Creating a RIA Services Class Library. Unfortunately, the support package for the Domain Service Wizard is now a dead link to the old codeplex site and I don't know where to get it.

I've downloaded the source from the current v4.5.4 release. I see there is a DomainServiceWizard folder in the OpenRiaServices.VisualStudio.DomainServices.Tools project. I was able to build the project in VS2015, but I do not know where to go from here.

I'll be honest that I'm a bit lost with getting started with OpenRiaServices even though I'm fairly experienced with WCF RIA Services. I'm not quite sure if I'm supposed to be using Colin's old templates or something else, but after a couple of days of playing around with this, I've gotten the furthest by using Colin's templates. If you can point me in the right direction, I'd appreciate it.

I've been doing all the above in Silverlight, but would also like to get this working in WPF.

BatteryMan commented 5 years ago

I slept on it and realized that I could just create the DomainService class manually (or generate it with WCF RIA Services, copy it over, and change the references to from System.ServiceModel to OpenRiaServices). I am now able to get OpenRiaServices to generate code on the Silverlight side.

If someone could still please chime in on my previous questions, it would be appreciated. I'll repeat them here in a more succinct manner:

  1. Where do I download and how do I install the support package for the Domain Service Wizard?
  2. Is Colin's templates still the preferred way to get started?
  3. How do I get OpenRiaServices working for WPF? Please correct me if I am wrong, but I believe Colin's templates predate the work done for WPF in OpenRiaServices.
Daniel-Svensson commented 5 years ago

Where do I download and how do I install the support package for the Domain Service Wizard? Is Colin's templates still the preferred way to get started?

I've started work on a new version to which I can publish updates at https://marketplace.visualstudio.com/items?itemName=OpenRiaServices.OpenRiaServicesTooling The new version will probably require that you use the 4.6.0 preview nuget packages and if you try to use any VB templates you must have the colins tooling installed as well.

How do I get OpenRiaServices working for WPF? Please correct me if I am wrong, but I believe Colin's templates predate the work done for WPF in OpenRiaServices.

The tooling does not yet contain any WPF project template, but you can have a look at https://github.com/Daniel-Svensson/OpenRiaPlayground/tree/master/HttpClient/WpfClient

an alternative is to start with silverlight code and then copy everything to a WPF project, but there are some issues you need to be aware of https://github.com/OpenRIAServices/OpenRiaServices/wiki/Desktop_WPF-Support-status

If you have the time and dedication I would definitely accept PRs to the empty Sample repository-

Hope that answers all your questions. Please let me know how it works and good luck.

BatteryMan commented 5 years ago

Thank you for the pointers. I chose to move things over from Silverlight to WPF. I have the code generation working in WPF, but am hitting the below runtime error when I create a new domain context.

In the generated code file, it crashes here with an InvalidOperationException in OpenRiaServices.DomainServices.Client.dll:

Public Sub New(ByVal serviceUri As Uri)
    Me.New(DomainContext.CreateDomainClient(GetType(ISSDBDomainServiceContract), serviceUri, false))
End Sub

The error message is:

Could not use ServerBaseUri and the serviceUri to create an absolute Uri.

Is there something that I have not set correctly?

BatteryMan commented 5 years ago

Of course, right after I submit my comment, I found this old thread from 2015 where you mention (in comment 9) that the full URI would be need to specified when creating a domain context. Did you ever get a simpler or automated way working for this?

After the specifying the full URI when creating my domain context, everything is working now.

Daniel-Svensson commented 5 years ago

You need to manually set a ServiceBaseUri in your apps App_Started event when you setup your domainclientfactory as you can see here https://github.com/Daniel-Svensson/OpenRiaPlayground/blob/2ec6b04a35f325369ccc8c5c6ac916a80114ea77/HttpClient/WpfClient/App.xaml.cs#L55

If you are using clickonce to update the app from the webpage you can get a uri from there. Just remember that you do want different URLs for development and production.

You can also start with a login screen where you can change the uri.

Daniel-Svensson commented 5 years ago

@BatteryMan since I haven't heard anymore from you I am assuming you got it al working.

I am closing the issue but feel free to open it again if that is not the case.