如何升級擴展支持Visual Studio 2019

本文章爲機器翻譯。 https://blogs.msdn.microsoft.com/visualstudio/2018/09/26/how-to-upgrade-extensions-to-support-visual-studio-2019/

最近,我在我30的擴展支持Visual Studio 2019的更新(16)。爲了確保他們的工作,我在一個非常早期的內部建設和2019測試我的手(在Visual Studio團隊有它的好處)。這個升級過程是我經歷過的最簡單的一種。

我想與你分享我的步驟,表明它是多麼容易,你會知道做什麼一旦Visual Studio 2019發佈。

vsixmanifest更新。
我們需要做一些更新的vsixmanifest文件。首先,我們必須更新支持的VS版本範圍。

<裝置靶>
這裏有一個版本,支持所有主要的和次要的Visual Studio 14版本(2015)和15(2017)所有的方式,但不包括16版。

<安裝installedbymsi =“false”>

<裝置靶id =“微軟Visual Studio。Pro版”=“[ 14.0,16.0)”/>

<安裝>
簡單的改變綁定的版本範圍從16到17上,像這樣:

<安裝installedbymsi =“false”>

<裝置靶id =“微軟Visual Studio。Pro版”=“[ 14.0,17.0)”/>

<安裝>
<前提>
其次,更新在<前提>元素版本範圍。這就是它以前的樣子:

<條件>

<前提id =“微軟Visual Studio。組件。coreeditor版”=“[ 15.0,16.0)“DisplayName =“Visual Studio核心編輯”/>

< /先決條件>
我們必須更新版本範圍之前有相同的上限,但在這種情況下,我們可以結合打開上結束,像這樣:

<條件>

<前提id =“微軟Visual Studio。組件。coreeditor版”=“[ 15,)“DisplayName =“Visual Studio核心編輯”/>

< /先決條件>
這意味着,前提需要15或更新版本。

如果你有microsoft.visualstudio.mpf依賴然後刪除它。這種依賴是一個遺留,沒有需要在Visual Studio 2010。它看起來像這樣:

<依賴>

<依賴ID =“微軟Visual Studio。強積金。14“DisplayName =“Visual Studio強積金”D:源=“安裝版”=“[ 14 ]”/>

< /依賴>
看到vsixmanifest文件更新。markdown編輯器,Bundler & Minifier, and圖片優化。

Next Steps
沒有什麼.夠了就要這些。You’re done.

Well, there is one thing that may affect your extension. Extensions that autoload a package has to do so in the background as stated in the blog post,Improving the responsiveness of critical scenarios by updating auto load behavior for extensions。You can also check out this walkthrough onhow to update your extension to use the AsyncPackage if you haven’t already.

什麼是引用microsoft.visualstudio.shell等組件?在Visual Studio的新版本,它們會自動被重定向到16當量和有向後兼容性保證它只會工作TM在我的經驗。 升級,他們在事實上做的工作。

我要回去加入VS 2019的支持,其餘的我的擴展。我有大約40個去。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章