Namespace and Shared Projects (shproj)

How do I get ReSharper to handle namespaces appropriately with shared projects?  

Here's the setup:

  • Project A is a C# test project (csproj) named ProjectName.Tests with default namespace ProjectName.Tests
  • Project B is a shared project (shproj) named ProjectName.Common with root namespace ProjectName.Common
  • Project A has a shared project reference to Project B
  • A file named SomeExtensions.cs is in Project B in a folder called Extensions, and the class within the file is in the namespace ProjectName.Common.Extensions

If I open the SomeExtensions.cs file the namespace is underlined, claiming "Namespace does not correspond to file location, should be: 'ProjectName.Tests.Extensions'".  I watched a webinar of resharper 9 that seemed to claim this should be working and didn't see any warnings in the open files.  Were they just turned off, or is there something I need to do to get this working?  I absolutely love this feature and would hate to have to disable it for this solution.

I'm using Resharper 9.0 Build 9.0.2014204.190166 (trial because other than this we haven't seen a need for 9.0 yet) and Visual Studio 12.0.31101.0

Comment actions Permalink

As an addition to this I upgraded ReSharper 9 to update 1 so i'm now running "ReSharper 9.0 Update 1 Build 9.0.20141219.130142".
Unfortunately the issue is still there.

Comment actions Permalink

Hello Arren,

  Please try installing ReSharper 9.1 EAP and check the issue there.

  If you are still experiencing the problem, please attach a sample demo solution which will demonstrate it.


Comment actions Permalink

Alexander, it's quite easy to reproduce... It happens with every shared project with Rider and Resharper. They can't properly detect the correct namespace. It's been a bug since Resharper 9 and still not fixed in the current latest release.

Comment actions Permalink

Hello Sam!


Thank you for the feedback.

Could you please provide some sample solutions introducing the issue?

Thank you.


Please sign in to leave a comment.