2010-08-16 24 views
0

如果我使用的代碼清理ReSharper的功能,我得到這個開始的文件:ReSharper清理我們的代碼並更改使用指令,以便StyleCop規則SA1200失敗。該怎麼辦?

using System.Web.UI; 

[assembly: WebResource("Company.Web.Resources.foo.js", "application/x-javascript")] 

namespace SiteSeeker.Web.WebControls 
{ 
    using System; 
    using System.Collections.Specialized; 
    using System.Reflection; 
    using System.Web; 
    using System.Web.UI; 
    .... 

然而,這觸發了SiteCop規則「SA1200:所有使用指令必須放置在命名空間內。」。是否存在一種配置ReSharper的把組裝線分成的方式:

[assembly: WebResource("Company.Web.Resources.foo.js", "application/x-javascript")] 

所以,我得到這個開始的文件:

[assembly: System.Web.UI.WebResource("Company.Web.Resources.foo.js", "application/x-javascript")] 

namespace SiteSeeker.Web.WebControls 
{ 
    using System; 
    using System.Collections.Specialized; 
    using System.Reflection; 
    using System.Web; 
    using System.Web.UI; 
    .... 

不會造成了StyleCop上火。或者我應該走這條路線並停用SiteCop規則?在ReSharper中使用代碼清理是我們想要的,因爲它很方便,幾乎可以與我們的StyleCop規則一起工作。

回答

相關問題