سؤال

Using Resharper 6.1 on Visual Studio 2010 I'm trying to do some basic code cleanup on a c# Web Application project.

In this process Resharper keeps adding a set of unnecessary import namespaces in some ascx files. Immidiately after Code cleanup is completed Resharper is suggesting that the using directive is not required and suggesting to remove them.

<%@ Import Namespace="System.Web.DynamicData" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="System.Web.UI.WebControls.Expressions" %>
<%@ Import Namespace="System.Web.UI.WebControls.WebParts" %>

Have anyone else experienced this?

I have tried changing the settings in R# Options > Code editing > Namespace Imports, and also disabling optimize Register directives/Using directives in ASP.NET and C# section in Code cleanup, but still it keeps adding these imports.

I should add that these imports are not used specifically in any parts of our application so why R# thinks I need them is a mystery.

UPDATE: This is a bug in earlier versions of Resharper. I upgraded to R# 8 and this fixed the issue.

http://devnet.jetbrains.com/message/5491245#5491245

هل كانت مفيدة؟

المحلول

According to Kenneth (who asked this question) this is fixed in ReSharper 8.

UPDATE: This is a bug in earlier versions of Resharper. I upgraded to R# 8 and this fixed the issue.

http://devnet.jetbrains.com/message/5491245#5491245

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top