What Was I Thinking?

Follies & Foils of .NET Development

  Home  |   Contact  |   Syndication    |   Login
  74 Posts | 0 Stories | 191 Comments | 0 Trackbacks

News

Archives

Post Categories

Check These Out

Gurus

Monday, October 12, 2009 #

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

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati