This is my setup:
MVC app
A domain model with a data access layer using Enitity Framework Code First
Silverlight application (displayed in the MVC App)
I'm using RIA Service to make the Silverlight App interact with the DB.
Ria services only supports entity framework 4.1 as of now. Current release is 4.3. Seems to be a waste to not get the new features of EF (like migrations and hopefully enum support in the future) just becouse of the Ria service for the Silverlight app.
My question is therefore:
Is it reasonable to rely on the Ria Service when using EF code first (i.e. will they always lag behind by so much? Could this be a problem down the road?)
Do you have an alternative solution where the Silverlight app is not so dependent on what version of the ORM i use?
RIA Services can be used with NHibernate or any other ORM or object/domain model. Only some of the VS Wizards imply there is coupling between EF and RIA Services, but you clearly aren't required to use those wizards nor is there a coupling between EF and RIA Services.
The answer to the question "Can I use RIA Services with Entity Framework 4.3?" is absolutely yes.
OData is an alternative to RIA Services, but it has quite a few limitations and is not intended as a direct competitor. WCF is also an alternative.
A workaround for getting migrations before RIA services properly supports EF4.3 could also be to create a project solely for migrations, similar in spirit to the database projects in Visual Studio Ultimate.
The model would need to be included by such a project via "add as link" and you'd need to make sure that it can compile in both projects. For example, you might need to define some dummy attribute that are defined in RIA-Services ("Include" would be one).
It's not ideal but maybe it's the best option in some cases.
To get a temporary workaround for the lock of version < 4.2 of the RiaServices.EntityFramework NuGet package, I've used the NuGet Package Explorer in order to change the metadata of the package and removed the constraint.
Remeber you must add the local cache as NuGet source.
Tools -> Options -> Package Manager -> Package Sources -> Add (C:/Users/%username%/Appdata/Local/Nuget/Cache)
Related
Our team has an existing .Net Core API solution. I'd like to add a series of function apps in a V2 functions project. This would allow reuse of the existing database repositories.
Is this possible / rational?
It is possible and rational. You can deploy just the functions app project, and have it running on Azure. Just remember to redeploy whenever there is a change in the dependent projects.
I need to develop an application for my distributed computing class, with one central server and multiple graphical clients. I was thinking of trying WCF for this, since I am already familiar with making .NET standalone desktop applications using Windows Forms or WPF.
Since I have never worked with WCF before, I am trying to follow a tutorial posted on MSDN, which has defining a service contract as its first major step.* Part of this involves creating a WCF Service Library project, which is supposed to be available as a template under the language of my choice (I am going to use C# here). However, I do not see this project template listed as an option in the new project dialog, and looking for WCF in the search bar returns no results.
How can I make this project template available for use in Visual Studio 2017?
* It should probably be noted that the tutorial mentions that it is written with Visual Studio 2012 in mind. Has anything changed since then that I should be aware of as far as the tutorial is concerned?
Open the installer, choose Individual Components and scroll down to Development Activities. Check the WCF checkbox:
I ended up re-running the Visual Studio Installer to modify my current setup. WCF is not explicitly listed anywhere, but I figured it might have been included as part of the .NET Core or ASP.NET workloads (which were not marked for installation the first time around). After adding these workloads to my installation and restarting Visual Studio 2017, I can now see the WCF project templates listed under C#.
Quick question
I am doing a Plural Sight tutorial on WCF and they are using the WCF Service Library (as opposed to application.)
When I go to Add new project there is no WCF Service Library. Not under any of the .NET versions.
I am using Visual Studio 2013 for Web Express.
Any one know how I can get it?
Thanks
You can find it under Templates WCF.
( Go to New Project->Installed-->Templates-->WCF)
I am getting this error in a WCF web service when the program attempts to use a method that employs the entity framework. However, we know that the server has the entity framework (correct version) installed because it is hosting another WCF web service and an intranet site that use it successfully.
I've tried to set copy local to true, however this simply compiles the Entity Framework dll into the debug/release folder of the project that uses it, not the web service project that gets deployed (the project that gets deployed contains a references the project that uses the entity framework).
Has anyone run into this kind of issue before and know a work-around either with or without using copy local?
The solution to this problem was to simply place the EntityFramework.dll and .xml file generated in the bin of the project that uses the Entity Framework and place that in the bin of the service project that was being deployed.
Check to see that the Application Pool for the IIS Site in question is set to use to correct .NET Framework version. In the case of EF 4.1, the Application Pool should be running on .NET Framework version 4 or higher.
To identify the version of .NET being used by the site, first find out the Application pool in use (in IIS, click on Basic Settings for the site), then identify the appropriate pool under the Application Pools node. The .NET Framework version should be listed.
Check whether bit versions are compatible between entity framework and server. If the server is 64 bit and you are using 32 bit entity framework dll you can get this error. Then change app pool setting to enable 32 bit applications.
I know that SharePoint 2010 uses .net 3.5 and since .net 2 (3.5 with sp1) has different CLR than .net 4, what is the best practice to use Entity Framework 4 (4.2) with it?
Is the web service (WCF service) the only solution for it?
If not, what is the best ORM similar to EF from simplicity and productivity prospective is recommended to use to connect to MS SQL Server? (may support oracle later)?
Is the web service (WCF service) the only solution for it?
Yes. You have to do cross process call because your main process is .NET 3.5 and you need another process running .NET 4.0.
What is the best ORM similar to EF from simplicity and productivity prospective is recommended to use to connect to MS SQL Server? (may support oracle later)?
Other alternatives are for example NHibernate or LLBGen Pro. Both are supported in .NET 3.5. You can also try Linq-To-Sql or SubSonic.