Hi All,
I am currently running Visual Studio Community 2017 version 15.9.2 on
an up-to-date Windows 10 system.
Many years ago, I developed a set of macro functions for Visual Studio (VS2005).
It utilized the EnvDTE object.
When Microsoft did away with macros, I was PO'ed.
At the time, I managed to figure out how to get my macro functions into an Add-in.
When Microsoft did away with Add-ins, I was PO'ed x 3.
I managed to figure out how to get my functions from the Add-in into a library,
then call into that library from a VSIX extension.
Recently, I tried to change a function within the library, then rebuild it.
It failed to build. I do not get any errors, but I have the following warnings:
Warning IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. Warning Cannot find wrapper assembly for type library "EnvDTE100". Verify that (1) the COM component is registered correctly and (2) your target platform is the same as the bitness of the COM component. For example, if the COM component is 32-bit, your target platform must not be 64-bit. Warning Cannot find wrapper assembly for type library "EnvDTE90". Verify that (1) the COM component is registered correctly and (2) your target platform is the same as the bitness of the COM component. For example, if the COM component is 32-bit, your target platform must not be 64-bit. Warning Cannot find wrapper assembly for type library "EnvDTE80". Verify that (1) the COM component is registered correctly and (2) your target platform is the same as the bitness of the COM component. For example, if the COM component is 32-bit, your target platform must not be 64-bit. Warning Cannot find wrapper assembly for type library "EnvDTE". Verify that (1) the COM component is registered correctly and (2) your target platform is the same as the bitness of the COM component. For example, if the COM component is 32-bit, your target platform must not be 64-bit.
The VSIX solution is separate from the solution that has the library with the Add-in,
so it is not relevant at this point.
I tried this:
Remove old COM references to EnvDTE, EnvDTE80, EnvDTE90 and EnvDTE100.
Add new references using Assemblies | Extensions tab and select EnvDTE, EnvDTE80, EnvDTE90,
EnvDTE100.
I've tried changing the platform and target CPU to x86 in my project properties.
I've checked the "Register for COM interop" on the properties window for the project.
I've also performed a repair install of Visual Studio 2017.
I deleted all of my references, and added everything via NuGet, and the Package Manager Console:
https://www.nuget.org/packages/EnvDTE/ Install-Package EnvDTE -Version 8.0.2 https://www.nuget.org/packages/EnvDTE80/ Install-Package EnvDTE80 -Version 8.0.3 https://www.nuget.org/packages/EnvDTE90/ Install-Package EnvDTE90 -Version 9.0.3 https://www.nuget.org/packages/EnvDTE90a/ Install-Package EnvDTE90a -Version 9.0.3 https://www.nuget.org/packages/EnvDTE100/ Install-Package EnvDTE100 -Version 10.0.3 installs a unofficial nuget package which includes the commandbar dll Install-Package Microsoft.VisualStudio.CommandBars -Version 8.0.0 https://www.nuget.org/packages/VSSDK.Shell.12/ Install-Package VSSDK.Shell.12 -Version 12.0.4 https://www.nuget.org/packages/Microsoft.VisualStudio.Shell.Interop.12.0/ Install-Package Microsoft.VisualStudio.Shell.Interop.12.0 -Version 12.0.30111 https://www.nuget.org/packages/VSSDK.DTE/ Install-Package VSSDK.DTE -Version 7.0.4 https://www.nuget.org/packages/VSSDK.DTE.9/ Install-Package VSSDK.DTE.9 -Version 9.0.4 https://www.nuget.org/packages/VSSDK.DTE.8/ Install-Package VSSDK.DTE.8 -Version 8.0.4 https://www.nuget.org/packages/VSSDK.DTE.10/ Install-Package VSSDK.DTE.10 -Version 10.0.4
This is the state of my project file at the time of this post:
<?xml version="1.0" encoding="utf-8"?><Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0"><PropertyGroup><Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration><Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform><ProductVersion>8.0.30424</ProductVersion><SchemaVersion>2.0</SchemaVersion><ProjectGuid>{ ... }</ProjectGuid><OutputType>Library</OutputType><StartupObject></StartupObject><AssemblyName>VSIX_to_Addin_01</AssemblyName><OptionStrict>Off</OptionStrict><NuGetPackageImportStamp></NuGetPackageImportStamp><TargetFrameworkVersion>v4.5</TargetFrameworkVersion><TargetFrameworkProfile /></PropertyGroup><PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "><DebugSymbols>true</DebugSymbols><DefineDebug>true</DefineDebug><DefineTrace>true</DefineTrace><IncrementalBuild>true</IncrementalBuild><OutputPath>bin\</OutputPath><DocumentationFile>VSIX_to_Addin_01.xml</DocumentationFile><RegisterForComInterop>false</RegisterForComInterop><Prefer32Bit>false</Prefer32Bit></PropertyGroup><PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "><DebugSymbols>false</DebugSymbols><DefineDebug>false</DefineDebug><DefineTrace>true</DefineTrace><IncrementalBuild>false</IncrementalBuild><Optimize>true</Optimize><OutputPath>bin\</OutputPath><DocumentationFile>VSIX_to_Addin_01.xml</DocumentationFile><RegisterForComInterop>false</RegisterForComInterop><Prefer32Bit>false</Prefer32Bit><PlatformTarget>x86</PlatformTarget></PropertyGroup><PropertyGroup><OptionExplicit>On</OptionExplicit></PropertyGroup><PropertyGroup><OptionCompare>Binary</OptionCompare></PropertyGroup><PropertyGroup><OptionInfer>On</OptionInfer></PropertyGroup><PropertyGroup><RootNamespace>VSIX_to_Addin_01</RootNamespace></PropertyGroup><PropertyGroup><SignAssembly>true</SignAssembly></PropertyGroup><PropertyGroup><AssemblyOriginatorKeyFile>VSIX_to_Addin_Sig_01.snk</AssemblyOriginatorKeyFile></PropertyGroup><PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"><DebugSymbols>true</DebugSymbols><DefineDebug>true</DefineDebug><DefineTrace>true</DefineTrace><OutputPath>bin\x86\Debug\</OutputPath><DocumentationFile>VSIX_to_Addin_01.xml</DocumentationFile><RegisterForComInterop>false</RegisterForComInterop><PlatformTarget>x86</PlatformTarget><CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet></PropertyGroup><PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"><DefineTrace>true</DefineTrace><OutputPath>bin\x86\Release\</OutputPath><DocumentationFile>VSIX_to_Addin_01.xml</DocumentationFile><Optimize>true</Optimize><RegisterForComInterop>false</RegisterForComInterop><PlatformTarget>x86</PlatformTarget><CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet></PropertyGroup><ItemGroup><Import Include="VSIX_to_Addin_01" /><Import Include="EnvDTE" /><Import Include="EnvDTE100" /><Import Include="EnvDTE80" /><Import Include="EnvDTE90" /><Import Include="EnvDTE90a" /><Import Include="Extensibility" /><Import Include="Microsoft.VisualBasic" /><Import Include="Microsoft.VisualStudio.Shell.Interop" /><Import Include="System" /><Import Include="System.Collections" /><Import Include="System.Data" /><Import Include="System.Diagnostics" /><Import Include="System.Windows.Forms" /></ItemGroup><ItemGroup><Compile Include="AssemblyInfo.vb"><SubType>Code</SubType></Compile><Compile Include="AUX1_Module.vb" /><Compile Include="Connect.vb"><SubType>Code</SubType></Compile><Compile Include="EnvironmentEvents.vb" /><Compile Include="Help_Module.vb" /><Compile Include="Main_Module.vb" /><Compile Include="Module1.vb" /><Compile Include="Unique_ID_Module.vb" /><Compile Include="XML_ctrl_module.vb" /></ItemGroup><ItemGroup><COMReference Include="EnvDTE"><Guid>{ ... }</Guid><VersionMajor>8</VersionMajor><VersionMinor>0</VersionMinor><Lcid>0</Lcid><WrapperTool>primary</WrapperTool><Isolated>False</Isolated><EmbedInteropTypes>False</EmbedInteropTypes></COMReference><COMReference Include="EnvDTE100"><Guid>{ ... }</Guid><VersionMajor>10</VersionMajor><VersionMinor>0</VersionMinor><Lcid>0</Lcid><WrapperTool>primary</WrapperTool><Isolated>False</Isolated><EmbedInteropTypes>False</EmbedInteropTypes></COMReference><COMReference Include="EnvDTE80"><Guid>{ ... }</Guid><VersionMajor>8</VersionMajor><VersionMinor>0</VersionMinor><Lcid>0</Lcid><WrapperTool>primary</WrapperTool><Isolated>False</Isolated><EmbedInteropTypes>False</EmbedInteropTypes></COMReference><COMReference Include="EnvDTE90"><Guid>{ ... }</Guid><VersionMajor>9</VersionMajor><VersionMinor>0</VersionMinor><Lcid>0</Lcid><WrapperTool>primary</WrapperTool><Isolated>False</Isolated><EmbedInteropTypes>False</EmbedInteropTypes></COMReference></ItemGroup><ItemGroup><Content Include="VSIX_to_Addin_01.AddIn"><SubType>Designer</SubType></Content><Content Include="C:\Documents and Settings\Ralph VSIX_to\My Documents\Visual Studio 2010\Addins\VSIX_to_Addin_01 - For Testing.AddIn"><Link>VSIX_to_Addin_01 - For Testing.AddIn</Link><SubType>Designer</SubType></Content><Content Include="zzz_Notes_01.txt" /></ItemGroup><ItemGroup><Folder Include="My Project\" /></ItemGroup><ItemGroup><WCFMetadata Include="Service References\" /></ItemGroup><ItemGroup><None Include="VSIX_to_Addin_Sig_01.snk" /><None Include="packages.config" /></ItemGroup><ItemGroup><Reference Include="envdte, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"><HintPath>..\packages\VSSDK.DTE.7.0.4\lib\net20\envdte.dll</HintPath><EmbedInteropTypes>False</EmbedInteropTypes><Private>False</Private></Reference><Reference Include="EnvDTE100, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><HintPath>..\packages\EnvDTE100.10.0.3\lib\net20\EnvDTE100.dll</HintPath><EmbedInteropTypes>True</EmbedInteropTypes></Reference><Reference Include="EnvDTE80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"><HintPath>..\packages\EnvDTE80.8.0.3\lib\net10\EnvDTE80.dll</HintPath><EmbedInteropTypes>True</EmbedInteropTypes></Reference><Reference Include="EnvDTE90, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"><HintPath>..\packages\EnvDTE90.9.0.3\lib\net10\EnvDTE90.dll</HintPath><EmbedInteropTypes>True</EmbedInteropTypes></Reference><Reference Include="EnvDTE90a, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"><HintPath>..\packages\EnvDTE90a.9.0.3\lib\net10\EnvDTE90a.dll</HintPath><EmbedInteropTypes>True</EmbedInteropTypes></Reference><Reference Include="extensibility, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"><EmbedInteropTypes>True</EmbedInteropTypes></Reference><Reference Include="MacroXMLLib01"><HintPath>..\..\XMLNtrf Library\MacroXMLLib-01\MacroXMLLib-01\bin\Release\MacroXMLLib01.dll</HintPath></Reference><Reference Include="Microsoft.VisualStudio.CommandBars, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"><EmbedInteropTypes>True</EmbedInteropTypes></Reference><Reference Include="Microsoft.VisualStudio.GraphModel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><HintPath>..\packages\VSSDK.GraphModel.11.0.4\lib\net45\Microsoft.VisualStudio.GraphModel.dll</HintPath><Private>False</Private></Reference><Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"><HintPath>..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6071\lib\Microsoft.VisualStudio.OLE.Interop.dll</HintPath></Reference><Reference Include="Microsoft.VisualStudio.Shell.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><HintPath>..\packages\VSSDK.Shell.12.12.0.4\lib\net45\Microsoft.VisualStudio.Shell.12.0.dll</HintPath><Private>False</Private></Reference><Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><HintPath>..\packages\VSSDK.Shell.Immutable.10.10.0.4\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll</HintPath><Private>False</Private></Reference><Reference Include="Microsoft.VisualStudio.Shell.Immutable.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><HintPath>..\packages\VSSDK.Shell.Immutable.11.11.0.4\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll</HintPath><Private>False</Private></Reference><Reference Include="Microsoft.VisualStudio.Shell.Immutable.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><HintPath>..\packages\VSSDK.Shell.Immutable.12.12.0.4\lib\net45\Microsoft.VisualStudio.Shell.Immutable.12.0.dll</HintPath><Private>False</Private></Reference><Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"><HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6072\lib\net11\Microsoft.VisualStudio.Shell.Interop.dll</HintPath></Reference><Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30320\lib\net20\Microsoft.VisualStudio.Shell.Interop.10.0.dll</HintPath><EmbedInteropTypes>True</EmbedInteropTypes></Reference><Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61031\lib\net20\Microsoft.VisualStudio.Shell.Interop.11.0.dll</HintPath><EmbedInteropTypes>True</EmbedInteropTypes></Reference><Reference Include="Microsoft.VisualStudio.Shell.Interop.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.12.0.12.0.30111\lib\net20\Microsoft.VisualStudio.Shell.Interop.12.0.dll</HintPath><EmbedInteropTypes>True</EmbedInteropTypes></Reference><Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"><HintPath>..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50728\lib\net11\Microsoft.VisualStudio.Shell.Interop.8.0.dll</HintPath></Reference><Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"><HintPath>..\packages\VSSDK.Shell.Interop.9.9.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.9.0.dll</HintPath><Private>False</Private></Reference><Reference Include="Microsoft.VisualStudio.TextManager.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"><HintPath>..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6071\lib\net11\Microsoft.VisualStudio.TextManager.Interop.dll</HintPath></Reference><Reference Include="Microsoft.VisualStudio.TextManager.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"><HintPath>..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50728\lib\net11\Microsoft.VisualStudio.TextManager.Interop.8.0.dll</HintPath></Reference><Reference Include="Microsoft.VisualStudio.Threading, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><HintPath>..\packages\VSSDK.Threading.12.0.4\lib\net45\Microsoft.VisualStudio.Threading.dll</HintPath><Private>False</Private></Reference><Reference Include="PresentationCore" /><Reference Include="PresentationFramework" /><Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"><HintPath>..\packages\VSSDK.DTE.7.0.4\lib\net20\stdole.dll</HintPath><EmbedInteropTypes>False</EmbedInteropTypes><Private>False</Private></Reference><Reference Include="System"><HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.dll</HintPath></Reference><Reference Include="System.Design" /><Reference Include="System.Drawing" /><Reference Include="System.Transactions" /><Reference Include="System.Windows.Forms" /><Reference Include="System.XML"><HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.XML.dll</HintPath></Reference><Reference Include="System.Xml.Linq" /><Reference Include="UIAutomationTypes" /><Reference Include="WindowsBase" /></ItemGroup><Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.Targets" /><PropertyGroup><PreBuildEvent>if exist "$(TargetPath).locked" del "$(TargetPath).locked"
if exist "$(TargetPath)" if not exist "$(TargetPath).locked" move "$(TargetPath)" "$(TargetPath).locked"</PreBuildEvent><PostBuildEvent></PostBuildEvent></PropertyGroup><ProjectExtensions /><Import Project="..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.16\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.16\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets')" /><Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"><PropertyGroup><ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText></PropertyGroup><Error Condition="!Exists('..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.16\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudio.SDK.EmbedInteropTypes.15.0.16\build\Microsoft.VisualStudio.SDK.EmbedInteropTypes.targets'))" /></Target></Project>
Can someone PLEASE tell me how to fix this?
THANK YOU!
Wally