Reputation: 311
I have Resharper 10 installed in Visual Studio 2013. My solution contains a view .cshtml file that displays a date using Razor. However, Resharper displays the DateTime with a red warning highlight, and prompts me to import the System.DateTime namespace - please see the linked image:
The strange thing is that when my colleagues open the solution on their machines - exactly the same code, using the same version of VS2013 with the same Resharper version - there is no Resharper error.
The namespaces section of the Web.config file in the Views folder looks like this:
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
</namespaces>
If I add the System namespace, ie:
<add namespace="System" />
.. then the issue goes away. But - this doesn't explain why the issue only appears on one machine, and not on others.
I've tried cleaning the solution, suspending & resuming Resharper, clearing the Resharper cache, deleting the .suo file for the project, etc.
This seems so simple, but I really cannot figure out why R# would warn me on one machine, but not on others, when the code and environment seem to be identical.
The solution builds and runs successfully, without any warnings. If I disable Resharper, the error disappears.
Any suggestions? Could Resharper's warning be a result of some wider configuration issue on my machine?
Upvotes: 1
Views: 1857
Reputation: 5638
I've had similar issues after cleaning up my PC. So in my case I uninstalled an old visual studio and some dependencies (which were clearly marked as VS 2010), but that also ended up removing stuff in my older .net libraries. So ReSharper complained - and it could always be fixed by specifically referencing specific libraries.
My recommendation
Upvotes: 0