dotnet / dotnet/project-system
Incorrect COMReference entry when using Office interop
- Dominant language
- C#
- Stars
- 1k
- Forks
- 415
- PR merge metrics
- No merged PRs in 30d
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`:
```xml
00020813-0000-0000-c000-000000000046
1
7
tlbimp
0
false
```
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**:
```xml
{00020813-0000-0000-C000-000000000046}
1
7
0
primary
False
True
```
As noted [here](https://github.com/dotnet/runtime/issues/796), in order to fix the situation, the project system needs to add `True`.
Contributor guide
Assessment
This issue has not been assessed yet.