簡體   English   中英

使用MSTest [DeploymentItem]的Resharper外部屬性

[英]Resharper External Attributes with MSTest's [DeploymentItem]

在某些情況下(比如在XAML中編寫URI時),ReSharper神奇地指出我正在寫出當前項目中文件的相對路徑,並為它提供了非常有用的智能完成,並且如果我拼錯了某些東西並得到它就會發出警告錯誤,如果我按住Ctrl鍵單擊它甚至會轉到該文件。

當我輸入MSTest的DeploymentItem屬性的參數時,我可以以某種方式告訴ReSharper這樣做嗎?

應該通過外部注釋工作 打開以下文件:

C:\\ Program Files(x86)\\ JetBrains \\ ReSharper \\ v7.1 \\ Bin \\ ExternalAnnotations \\ Visual Studio \\ Microsoft.VisualStudio.QualityTools.UnitTestFramework.xml

(或者你正在使用的任何版本的Resharper。)

assembly標記內添加以下行:

<member name="M:Microsoft.VisualStudio.TestTools.UnitTesting.DeploymentItemAttribute.#ctor(System.String)">
    <parameter name="path">
        <attribute ctor="M:JetBrains.Annotations.PathReferenceAttribute.#ctor" />
    </parameter>
</member>
<member name="M:Microsoft.VisualStudio.TestTools.UnitTesting.DeploymentItemAttribute.#ctor(System.String,System.String)">
    <parameter name="path">
        <attribute ctor="M:JetBrains.Annotations.PathReferenceAttribute.#ctor" />
    </parameter>
</member>

這告訴Resharper在DeploymentItem的兩個構造函數的path參數上拋出PathReference屬性。

但是 ,經過一段時間的測試后,我無法看到這個屬性適用於我在C#文本編輯器中嘗試的任何內容。 它可能不適用於我的版本(7.1),但我有點難過。 也許有人可以加入這個?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM