我有一個擴展,我要從 VS2019 更新到 VS2022。它是使用建模 SDK 的 DSL,并通過 T4 模板生成代碼。
我已經對其進行了相當大的轉換,但是在運行 T4s 時,我得到了
Compiling transformation: The type 'SourceControl' exists in both 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'Microsoft.VisualStudio.Interop, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Compiling transformation: The type 'Project' exists in both 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'Microsoft.VisualStudio.Interop, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Compiling transformation: The type 'Constants' exists in both 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'Microsoft.VisualStudio.Interop, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Compiling transformation: The type 'ProjectItem' exists in both 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'Microsoft.VisualStudio.Interop, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Compiling transformation: The type 'ProjectItems' exists in both 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'Microsoft.VisualStudio.Interop, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Compiling transformation: The type 'DTE' exists in both 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'Microsoft.VisualStudio.Interop, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Compiling transformation: The type 'Solution' exists in both 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'Microsoft.VisualStudio.Interop, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
并且無法弄清楚如何解決這個問題。
我沒有在我的主.tt檔案中包含這些程式集,也沒有在我的Dsl或DslPackage專案中參考它們,但我從其他一些錯誤中了解到我必須解決這個問題,EnvDTE8.0并且Microsoft.VisualStudio.Interop作為 VS2022 環境的一部分隱式可用。由于它們不是我的專案的一部分,我無法使用 Visual StudioAlias機制來消除歧義。
我已經閱讀了關于類似問題的其他問題,但它們都不是這個問題,它們的解決方案確實不適用。
感謝任何人可以提供的任何幫助或指導。
uj5u.com熱心網友回復:
今天我的 T4 模板遇到了類似的問題。在看了你的帖子并在上面閑逛了幾分鐘后,我嘗試了以下操作
我找到了正在添加EnvDTE程式集的檔案
<#@ assembly name="EnvDTE"#>
并將其更改為
<#@ assembly name="Microsoft.VisualStudio.Interop"#>
這解決了我的問題。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/360515.html
標籤:。网 视觉工作室 t4 视觉工作室2022 dsl-工具
上一篇:org.apache.catalina.connector.ClientAbortException:現有連接被遠程主機強行關閉
