Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "ResolveComReference" task could not be instantiated from "Microsoft.Build.Tasks.Core... #240

Closed
ryanmelv opened this issue Jul 21, 2021 · 2 comments
Labels
answered Question answered, no more to do

Comments

@ryanmelv
Copy link

ryanmelv commented Jul 21, 2021

This may actually be an enhancement request to (more fully) support Visual Studio Code if it turns out the error is specific to Visual Studio Code.

Describe the bug

        The "ResolveComReference" task could not be instantiated from "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Could not load file or assembly 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

To Reproduce

  1. Clone repo to local folder.
  2. Open project folder using Visual Studio Code.
  3. Observe text output.

Note that this occurs when opening the project (not when trying to build the project).

Expected behavior

Project to open without error messages.

Screenshots

See attached full error output text, from the Visual Studio Code output window upon opening the OneMore project.

vsc-omnisharp-output.txt

Environment (if applicable):

Visual Studio Code v1.58.2
Extension: C# for Visual Studio Code v1.23.13
Microsoft .NET Framework 4.8 SDK
Microsoft .NET SDK 5.0.302 (x64)
OneMore v3.24

Additional context

I do see that the OneMore perquisites include MS VS 2019 and the Microsoft Visual Studio 2019 Installer Projects extension. But I was hoping it would open (and build) in Visual Studio Code.

I do not see that the Microsoft Visual Studio 2019 Installer Projects extension works with Visual Studio Code:

https://marketplace.visualstudio.com/items?itemName=VisualStudioClient.MicrosoftVisualStudio2017InstallerProjects

And I do not see an equivalent for Visual Studio Code.

Perhaps the error I see is purely because I do not have the Microsoft Visual Studio 2019 Installer Project extension?

If so, perhaps there is a workaround or change that could accommodate building the project using Visual Studio Code?

I did find these related articles:

[1] dotnet/vscode-csharp#3766

A bug report for omnisharp-vscode (used by the VSC "C# for Visual Studio Code" extension) about the "ResolveComReference" error message.

[2] https://stackoverflow.com/questions/44119631/resolvecomreference-task-could-not-be-loaded

An article about the same error message, with response indicating that COM references are not supported by the .NET Core version of MSBuild, and that perhaps a workaround is to build the project strictly using the "msbuild" CLI. Perhaps this is an avenue to build OneMore using Visual Studio Code?

@ryanmelv ryanmelv added bug Something isn't working unread I have seen it or had time to refine it yet labels Jul 21, 2021
@stevencohn
Copy link
Owner

Unfortunately, not sure I can resolve this at this time due to the fact the OneMore depends on a COMReference to OneNote and this is what OmniSharp is complaining about. There is a future plan of migrating OneMore to .NET 5 or 6 - but that's probably a long ways off.

If you don't have the big VS and are worried about license costs, you should be able to use the Community edition for free.

@stevencohn stevencohn added answered Question answered, no more to do and removed bug Something isn't working unread I have seen it or had time to refine it yet labels Jul 21, 2021
@ryanmelv
Copy link
Author

ryanmelv commented Jul 22, 2021

Hi Steven,

Thank you for the quick reply! I mostly just wasn't certain if what I encountered was specific to Visual Studio Code, and so didn't want to pursue VS if there was something simple/known I could do to continue down the Visual Studio Code path. Since it sounds like what I encountered is specific to VSC I can go get and try VS. Thank you for reviewing this and for your reply!

Regards,
Ryan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered Question answered, no more to do
Projects
None yet
Development

No branches or pull requests

2 participants