-
Notifications
You must be signed in to change notification settings - Fork 408
Open
Labels
Bug BashIssues to be handled during our bug fixing pushIssues to be handled during our bug fixing pushNeeds-CPS-workChanges are needed in the closed-source Common Project System (CPS) repo.Changes are needed in the closed-source Common Project System (CPS) repo.Parity-Legacy-FeatureMissing features from the legacy project system.Missing features from the legacy project system.Triage-ApprovedReviewed and prioritizedReviewed and prioritized
Milestone
Description
To include Excel interop libraries in .NET Core app, I do the following: Dependencies -> Add Reference -> COM -> Microsoft Excel 14.0 Object Library. When I do this, I get the following ItemGroup:
<ItemGroup>
<COMReference Include="Microsoft.Office.Excel.dll">
<Guid>00020813-0000-0000-c000-000000000046</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>7</VersionMinor>
<WrapperTool>tlbimp</WrapperTool>
<Lcid>0</Lcid>
<Isolated>false</Isolated>
</COMReference>
</ItemGroup>However, I get the following runtime error:
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. The system cannot find the file specified.
In order to work, I have created .NET Framework app, added COM reference there and copied its COMReference - and it works:
<ItemGroup>
<COMReference Include="Microsoft.Office.Interop.Excel">
<Guid>{00020813-0000-0000-C000-000000000046}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>7</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>primary</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>As noted here, in order to fix the situation, the project system needs to add <EmbedInteropTypes>True</EmbedInteropTypes>.
theta3, dorian-apanel-intel and rgwood
Metadata
Metadata
Assignees
Labels
Bug BashIssues to be handled during our bug fixing pushIssues to be handled during our bug fixing pushNeeds-CPS-workChanges are needed in the closed-source Common Project System (CPS) repo.Changes are needed in the closed-source Common Project System (CPS) repo.Parity-Legacy-FeatureMissing features from the legacy project system.Missing features from the legacy project system.Triage-ApprovedReviewed and prioritizedReviewed and prioritized