Condividi tramite


Workaround to Data Source Window not populating RIA Services Domain Context Objects

Recently, we found a bug that hidden in the WCF RIA Services RC release setup authoring, which causes the Data Source Window cannot populate RIA Services Domain Context objects, and the Live IntelliSense doesn’t work. This only happens when the VS2010 is not installed in the default VS installation path. For example, if your default system root is C:\ (then the default path will be under C:\$(Program Files)\Microsoft Visual Studio 10.0...), while you install the VS2010 into D:\, then you would meet with the issue. The setup authoring in this case doesn’t install some feature assemblies into the right location. We feel very sorry to find this issue so late and will fix it in WCF RIA Services RTW, and meanwhile, you could try the following workaround to get it work.

The workaround is to copy the feature assemblies installed into the wrong location to your machine to the right path. The feature assemblies now are always installed in your system root under $(ProgramFiles)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\RiaTools, which includes two folders of Data Binding and Live IntelliSense. And you’ll have to keep this folder structure and copy them into where you installed your VS2010.

For example, if your system root is C:\, and your $(Program Files) is Program Files, then those assemblies are installed at C:\Program Files\ Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\RiaTools. If your VS2010 is installed at D:\Program Files\Microsoft Visual Studio 10.0, then you will need to copy these assemblies under this path: D:\Program Files\ Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\RiaTools. There might be some folders missing in your VS2010 installation path, and you will need to create the corresponding folders for it.

Hope it helps.

Comments

  • Anonymous
    April 12, 2010
    Finally..Finally.. I was facing this problem from a long time now. Its working now. Thanks for the solution :)

  • Anonymous
    April 12, 2010
    Thanks Dhaval. It's glad to know that the workaround can solve your problem. If you find any other issues, please don't hesitate to let us know. Thanks! Xiaoying Guo Program Manager, Visual Studio Business Applications Tooling

  • Anonymous
    April 19, 2010
    What's the work-around if we installed it in the default location?  I installed in default location and I don't have the domain service context objects in my data source window.  VS 2010 Ultimate release, Silverlight 4, Ria Services Toolkit. Hour 3 and counting...

  • Anonymous
    April 21, 2010
    Like Jibber: What do we do if it's still not showing and things were installed in the correct (default) folder? 11:54PM EST

  • Anonymous
    April 21, 2010
    Jibber / TFisher, Could you please provide more detailed repro steps about your Data Source Window doesn't show? Does it work if you add other data sources through Add New Data Source link in the Data Source Window (such as Objects)? Thanks, Xiaoying

  • Anonymous
    April 21, 2010
    Xiaoying, I'm following the Silverlight HandsOnLab: "Building Applications in Silverlight 4 Module 2:Event Manager Application with WCF RIA Services, Creating and Editing Data, and Data Binding" Create the Domain Services

  1. Expand the Services node in the web project.
  2. Add a new service by right-clicking on the Services item and select Add→New Item….
  3. In the Add New Item dialog, choose the Visual C#→Web item on the left.
  4. Select the Domain Service Class template in the middle. there are a lot of web templates. Visual Studio 2010 5. Name the new item EventManagerDomainService, and click Add. This will show a dialog that will let you pick the Entity Framework EDM you just created, and the entities from that EDM you’d like to use in your service.
  5. Check all the checkboxes since we want all the entities to be available and editable to the Silverlight client. (We’ll deal with access control in a later lab.)
  6. Check the Generate associated classes for metadata checkbox: Figure 4 Add a New Domain Service Class
  7. Click OK. Add Data Bindings and Domain Context
  8. In the SlEventManager project, expand the Views folder and double click Home.xaml.
  9. Delete the contents of the Grid. You should just have the root navigation:Page element containing a Grid, which should be empty.

Notes from TFisher: The next steps STEPS 3 and 4 are the issue: UserRegistrationContext doesn't show in the Data Source Window


  1. Open Visual Studio’s Data Sources panel, which can be opened with the Data→Show Data Sources menu item. Unless you’ve rebuilt the project since you added the service, you may see just one entry in here, UserRegistrationContext, which corresponds to the domain service that was put in the project by the Silverlight Business Application template.
  2. Build the project again. You should see EventManagerDomainContext, which will contain child items for each of the entities in your EDM: I am running Windows 7 with MS VS2010 v. 10.0.30319.1 RTMRel MS .Net v. 4.0.30319 RTMRel
  • Anonymous
    April 21, 2010
    TFisher, Could you please do the following 3 things for me to have some better idea of the issue? Could you please let me know your VS installation path (even you use the default) and the path that you can find RiaTools folder (please also let me know what the assemblies are there). Could you please try this:
  1. Use "Silverlight Business Application" template to create a new project.
  2. Open the MainPage.xaml and build the project.
  3. Open the Data Source Window and let me know what displays there (if it's empty, please let me know what message string displaying there). Could you please also try this:
  4. Add a DomainService class in .web project
  5. Add some query method (you can just copy an existing query method and rename it)
  6. NOT build the project
  7. Go to the Silverlight (client) project and open the .g.cs / .g.vb file in the hidden folder Generated_Code
  8. Please check and let me know if this file is updated and contains with the new query method file that you've added This will tell if the assemblies are installed correctly and loaded. Thanks! Xiaoying
  • Anonymous
    April 21, 2010
    Xiaoying, My install path: c:Program Files (x86)Microsoft Visual Studio 10.0Common7IDEExtensionsMicrosoft
  1. Open the Data Source Window and let me know what displays there (if it's empty, please let me know what message string displaying there). After building project, DSW shows "Your project has no sources associated with it...." Add New Data Source

  1. Add a DomainService class in .web project Added ADO.Net Entity Data Model for SLEventManager.mdf (table: Event) After adding Domain Service Class (no build) -Generated_Code --BusinessApplication1.Web.g.cs File ONLY contains AuthenticationService domain service and UserRegistrationService domain service File has no reference to the TestDomainService I created. Thanks
  • Anonymous
    April 21, 2010
    TFisher, Do you also have a Program Files folder instead of Program Files(x86) folder? If so, I assume VS is also partly installed in Program Files folder. Could you please try to copy the c:Program Files (x86)Microsoft Visual Studio 10.0Common7IDEExtensionsMicrosoftRiaTools to c:Program FilesMicrosoft Visual Studio 10.0Common7IDEExtensionsMicrosoftRiaTools and see if it works? Seems Live IntelliSense doesn't work to you either, so I susppect if the dlls are not actually loaded. By the way, does your TestDomainService1 contain some methods? Thanks! Xiaoying

  • Anonymous
    April 21, 2010
    Xiaoying , Files were not there, so I copied them over.  Reboot. Created Sivlerlight Bus App. Same result. The TestDomainService1 contains: public class TestDomainService1 : LinqToEntitiesDOmainService<SlEventmanagerEntities> { public IQueryable>Attendee> GetAttendees() {  return this.ObjectContext.Attendees; } }

  • Anonymous
    April 22, 2010
    Hmm... it sounds weird. TFisher, I'm not sure but is it possible that you could share your desktop so that we can have some quick investigate? If you'd like, we can talk through email. That is my name xiaoying at microsoft.com. Thanks, Xiaoying

  • Anonymous
    April 25, 2010
    Did you guys come up with a solution? I have the same exact problem, i can't go on with the tutorial.

  • Anonymous
    April 26, 2010
    This has just been driving me up the wall for the last couple of hours too. VS2010 Ultimate installed in e:program files. Copied the IDEExtension ... stuff into e:program files but still not working.

  • Anonymous
    April 26, 2010
    Hi Phil, May I know your full installation path of VS, and the full extension files path after you move those assemblies? By the way, are you using VS2010 RTM? Thanks, Xiaoying

  • Anonymous
    April 26, 2010
    Hi Xiaoying, It is the release version of VS2010 Ultimate. The version uploaded to the MSDN subscriber downloads site on 12/04/2010. The full installation path is e:Program FilesMicrosoft Visual Studio 10.0. The location of the files after copying is e:Program filesMicrosoft Visual Studio 10.0Common7IDEExtensionsMicrosoftRiaTools Just cut and copies the whole of the c:Program FilesMicrosoftVisual Studio 10.0Common7IDE folder in to the same folder on the e drive. I need to get this working so I am going to try uninstalling everything to do with VS2010 and SL4 and re-install it using the default location.

  • Anonymous
    April 26, 2010
    Forgot to say the OS is Windows Server 2008 Enterprise.

  • Anonymous
    April 27, 2010
    Hi Xiaoying, I have un-installed everything to do with VS 2010 and SL4 and reinstalled accepting the defaults.  It still doesn't work. Created a new Business Application, added an  Entity Data Model pointing at slEventManager and then added a DomainServiceClass pointing to the EDM. Still no data sources visible. I'm not sure what timezone you are working in but I'm happy to share my desktop if it will help you track this problem down. Kind regards, Phil

  • Anonymous
    April 27, 2010
    Hi Phil, The team for the Data Source Window is in Shanghai, China, which is at UTC+8 tine zone. It'd be great if you could share the desktop for us to investigate! Could you please send me an email (xiaoying at microsoft.com) or let me know how I can get in touch with you to talk more about how and when to do it? Thanks! Xiaoying

  • Anonymous
    April 27, 2010
    The comment has been removed

  • Anonymous
    May 04, 2010
    I have a project I upgrade from SL3 / RIA Beta to the VS 2010 RTW and RIA Services RC. I see my old domain service in the data sources window, but I added a new domain service to my Web project and it doesn't show up in the data sources window. I tried the workaround (I had installed in the default place but I'm on a 64 bit machine so it was in the Program Files (x86) area) and there's no difference. Is there any way to get the Data Sources to add my new domain service ?

  • Anonymous
    May 04, 2010
    Hi, Thanks Phil for sharing the desktop with us. The problem is resolved, which is caused by some assemblies not loaded. It's not a common case that we've seen and we are still investigating the root cause. To workaround it, the easist way is to copy (not cut) the assemblies under:

  1. ...Microsoft Visual Studio 10.0Common7IDECommonExtensionsDataDesign
  2. ...Microsoft Visual Studio 10.0Common7IDEExtensionsMicrosoftRiaToolsDataBinding to ...Microsoft Visual Studio 10.0Common7IDE Please let me know if it still doesn't works. Thanks, Xiaoying
  • Anonymous
    May 04, 2010
    Confirming this workaround works, although links to this fix really should be forwarded to the docs team so they can update this walkthrough: http://msdn.microsoft.com/en-us/library/ee796239(v=VS.91).aspx And any other docs that feature this functionality. If you're going to take the time to blog the fix try to update the docs team so it ripples through the learning experience.

  • Anonymous
    May 05, 2010
    Hi Crispin, Thanks for your suggestion! We will keep your suggestion in mind next time when we find critical bugs in a release. For the current release, because the RIA Services RTW is drawing near, and the fix for this has been in there, I won't ask the doc team to add the link though. If you have any other suggestion or comments, I'd also appreciate it if you could let me know. Thanks, Xiaoying

  • Anonymous
    May 06, 2010
    Hello, I did all steps as described and copied all assemblies to the according directories. The DSW is now showing the DataContexts, but I'm still not able to drag an item from the DWS to a XAML - page. An error occurs "The event handler '' could not be found for appending statements". I'm running VS2010 on 64bit Windows 7 on drive D. Any help appreciated, wos

  • Anonymous
    May 09, 2010
    Never mind. It works on another (identical!) XAML page now, after a few reboots. Probably something got broken with the old XAML while I was fussing around with the assemblies for the DWS. Thanks.

  • Anonymous
    May 12, 2010
    I was having the same problem with the VS 2010 RTM (premium) installed on "G" drive. Copying RIA Tools from the "C" folder to "G" in the install directory worked. I would reccommend getting the word out in the forums as well as adding a note to the walkthrus. I bumped into this workaround quite by accident. How many others are missing it?

  • Anonymous
    June 07, 2010
    Great! Thanks for sharing this! It worked a charm!! Thierry

  • Anonymous
    June 07, 2010
    Thanks Thierry. By the way, the bug has been fixed in the RIA Services v1 final release. More info can be found at the post below: blogs.msdn.com/.../silverlight-4-tools-for-vs2010-and-wcf-ria-services-1-0-released.aspx Thanks, Xiaoying

  • Anonymous
    June 24, 2010
    I think you guys are going to have a hard time getting people to learn WCF RIA services when the tutorial cannot be followed due to bugs. NOTE - this bug still exists in the v1 final release!

  • Anonymous
    June 24, 2010
    Hi Colin, Could you please let me know how you installed your VS when you see the bug still exist in the V1? Does it work after you re-open the project? Thanks, Xiaoying

  • Anonymous
    July 15, 2010
    Off topic slightly but I dont know where to post this. In the data sources window you can select which control to use for an entity. I used to have the datagrid in the drop down list but it has disappeared. I can still add the datagrid manually and hook it up to the domaindatasource but do you have any idea how I can get it back in the dropdown. I have tried custom but datagrid is not listed there either.

  • Anonymous
    July 15, 2010
    Hi Nigel, Do you remember what you did before the DataGrid disappeared from the drop-down list (such as what you installed)? Do it repair the issue if you re-install the RIA Services? Thanks, Xiaoying Guo Program Manager, Visual Studio Business Applications Tooling

  • Anonymous
    August 11, 2010
    Not sure if this is related, but this is happening in my domain service when I implement IAuthentication. If the interface is not implemented it works. I have tried the steps mentioned, but no luck.

  • Anonymous
    August 11, 2010
    Hi Ronny, The Data Source Window doesn't repect IAuthentication implementation because of the different context in authentication scenarios. Thanks, Xiaoying

  • Anonymous
    August 12, 2010
    Are there any workarounds for this? We need custom authentication in our service, but the management won't accept the loss of design time support.

  • Anonymous
    August 14, 2010
    Hi Ronny, The Data Source Window would fiter all the implementation from IAuthentication, and there's no workaround directly for this. But could you please tell me more about your scenario / your project? How would you like to customize the authentication and also leverage the Data Source Window? We could try and see if there's any other way to solve your problem. If it's not convenient for you to saying it here, you could reach me at xiaoying @ microsoft.com. Thanks, Xiaoying