Search code examples
c#msbuildcsprojvisual-studio-codeomnisharp

OmniSharp error loading projects with COMReferences in Visual Studio Code


Having issues loading projects in the new Visual Studio Code that work fine in Visual Studio 2013. I was able to load other projects that don't have COMReferences in Visual Studio Code. Using Windows 7 Enterprise.

Relevant snippet from .csproj file:

<ItemGroup>
    <COMReference Include="DTOLib2">
      <Guid>{DBE2B0CE-6BE9-48FE-8300-6ABE0DB9692B}</Guid>
      <VersionMajor>1</VersionMajor>
      <VersionMinor>0</VersionMinor>
      <Lcid>0</Lcid>
      <WrapperTool>tlbimp</WrapperTool>
      <Isolated>False</Isolated>
      <EmbedInteropTypes>True</EmbedInteropTypes>
    </COMReference>
  </ItemGroup>

Relevant snippet from OmniSharp Log:

[ERROR:OmniSharp.MSBuild.MSBuildProjectSystem] The "ResolveComReference" task could not be instantiated from "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". The domain manager specified by the host could not be instantiated.

[ERROR:OmniSharp.MSBuild.MSBuildProjectSystem] The "ResolveComReference" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name.


Solution

  • Updating to Visual Studio Code 0.7.0 solves this issue :)