0

I'm trying to install Sitecore.Kernel version 10.0.0 on Visual Studio 2019 solution running on .net framework 4.8 and I get following error.

Severity    Code    Description Project File    Line    Suppression State
Error       Failed to add reference. The package 'Microsoft.AspNet.WebApi.Client' tried to add a framework reference to 'System.Net.Http' which was not found in the GAC. This is possibly a bug in the package. Please contact the package owners for assistance.
Error HRESULT E_FAIL has been returned from a call to a COM component.              

Based on the error it looks like it is an issue with dependency package 'Microsoft.AspNet.WebApi.Client' failing to install 'System.Net.Http'

I tried the following to resolve the issue

  1. Installed 'System.Net.Http' on its own
  2. Tried to install 'Microsoft.AspNet.WebApi.Client', still I get the same error.

Any help around this issue is really appreciated.

3
  • Can you try to see if manually adding System.Net.Http to the project references will solve the issue? You need to also verify the .net framework version in your project settings. Feb 26, 2021 at 6:51
  • Are you installing without dependencies? In my opinion, that is the best way..
    – Gatogordo
    Feb 26, 2021 at 8:14
  • No, I tried that. Feb 26, 2021 at 14:12

1 Answer 1

0

I figured out what the issue was, its user error :(

When I created the ASP.Net Web Application Project, I missed selecting MVC as a option.

enter image description here

Once I removed the project and recreated it with MVC as a option, it allowed me to add Sitecore.Kernel as reference without any issues.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.