原因
官方提供的
https://github.com/ADN-DevTech/AutoCAD-Net-Wizards/blob/ForAutoCAD2020/AutoCADNetWizardsInstaller/AutoCAD_2020_dotnet_wizards.zip
支持的是.net framework 4.7 和 VS2017。
目的
支持.net framework 4.7.2 和 VS2010
步驟
-
下載代碼https://github.com/ADN-DevTech/AutoCAD-Net-Wizards.git
-
切換到分支ForAutoCAD2020
-
下載並安裝https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2019Extension
-
下載並安裝https://www.7-zip.org/download.html,在環境變量Path里面加上一條7z的安裝路徑C:\Program Files\7-Zip(具體看安裝路徑);
-
下載並安裝https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311.exe
-
打開AutoCADNetWizardsInstaller\AutoCADNetWizards.sln 如果提示.net 框架問題,可以選擇先加載后修改
-
打開AutoCADNetWizards 工程
-
打開AutoCADNetWizards.wxs,修改 [VS2017] 為 [VS2019],以及
中 460798 為 461814(Win10 則為 461808)中的 4.7 為4.7.2 -
打開directory.wxi,修改 [VS2017] 為 [VS2019]
-
打開property.wxi,修改[2017] 為 [2019]
Key="SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7" Name="15.0" Type="directory" /> 改為:
Key="SOFTWARE\WOW6432Node\Microsoft\VisualStudio\VSPerf" Name="CollectionToolsDir2019" Type="raw" /> -
打開AutoCAD CSharp plug-in工程,修改MyTemplate.vstemplate中的4.7 為4.7.2
-
編譯AutoCADNetWizards ,生成msi
參考資料:
https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed
http://blog.sina.com.cn/s/blog_6cbf08ad0102vs0k.html