What Was I Thinking?

Follies & Foils of .NET Development
posts - 95 , comments - 352 , trackbacks - 0

Using Resharper with RIA Services.

I’m a big fan of Resharper.  Its loaded with refactoring and best practice guidance that makes me a better developer.  I’ve also started working with .NET RIA services.  The verdict is still out on RIA services, but I think I like them. Unfortunately RIA has an interesting approach to code sharing between the web and Silverlight project that's incompatible with Resharper.  It used generated code that is technically excluded from the project.   As a result, any code in my Silverlight project that references any of the shared classes won’t resolve for Resharper and valid code ends up looking like this:

 

image

 

This is likely to be addressed in a future version of Resharper (if RIA services takes hold), until then you can still get Resharper to resolve your shared code by:

  1. Select your Silverlight project in the Solution Explorer
  2. Select the Show All Files option from the Solution Explorer toolbar.
  3. Right-Click on the Generated Code folder and select Include In Project

As part of the project, Resharper will pick up the generated shared code and resolve your shared classes appropriately.  During compilation you may receive an warning about modifying a project file during compilation.  Just continue with the warning (in my case, I simply suppress the warning dialog so I’m not bothered with it).

 

With Generated Code include in my project, Resharper is back in full effect.

image

Print | posted on Monday, October 12, 2009 8:35 AM | Filed Under [ Silverlight ]

Feedback

Gravatar

# re: Using Resharper with RIA Services.

Thanks to your post I did not pull all my hair out... only about 90%

10/24/2009 10:25 PM | Corne Kruger
Gravatar

# re: Using Resharper with RIA Services.

How did you suppress the warning dialog. It's disgustingly annoying.
12/2/2009 4:50 AM | JES
Post A Comment
Title:
Name:
Email:
Comment:
Verification:
 

Powered by: