When using EF Code First, It appears WCF RIA Services Wizard (that runs when adding a new DomainService) in VS 2012 does not recognize the DbContexts defined in the project (it only recognizes the ObjectContext).
This means that when Adding a New Item in VS2012 and choosing Add DomainServiceClass, the wizard is not able to detect available context classes * combo list is empty *
Please see the attached image
Any idea what could be happening here? Thanks, -Sumit

This is a known issue with Visual Studio 2012, WCF RIA Services and Entity Framework, cause the Wizard to create new Domain Services doesn´t know the DbContext types.
The simple solution is to continue using Visual Studio 2010 to create Entity Models. Although using RIAServices.EntityFramework NuGet package won´t work, cause it doesn´t support current Versions of Entity Framework.
Another solution is to change the type of your Context from DbContext
to ObjectContext
.
Theres also a KB article for that specific scenario.
Update: An update to WCF Ria Services was released to support EF 5 and the usage of DbContext. More information can be found here.
I believe that the wizard don't find your class due to the fact that WCF ria is older than EF 5. Try to redirect the assembly binding to
<runtime>
<legacyUnhandledExceptionPolicy enabled="1" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
...
let us know if it works
This is now possible with the 4.2 release of WCF RIA Services.
If you create a WCF RIA project and get prompted to select a Windows Phone version, this is a reported issue you need remove Windows Phone 8.0 & 7.1 SDK.
If then you get an error to do with project templates perform a repair on WCF RIA 1.0 SP2 which you should have already installed.
来源:https://stackoverflow.com/questions/12843467/wcf-ria-services-wizard-not-working-with-codefirst