2

I need use AuthenticationHeaderValue for getting token

var token = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes($"{username}:{password}")));

so I have to install System.Net.Http package but when I install it via package manager console it give that error what should I do? what is AuthenticationHeaderValue alternative?

Could not install package 'System.Net.Http 4.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework.

1 Answer 1

1

Install System.Net.http version which is compatible to your .Net Framework

Sign up to request clarification or add additional context in comments.

1 Comment

How do you know which one is? Especially the one compatible to the question, that is, .Net Framework 4.0?

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.