1

I am doing a project that use both .net framework and .net core.

I want to call repository that fetch data in API controller of .net core but i get the following error:

System.TypeLoadException: 'Could not load type 'System.Web.HttpContext' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.'

Pls help me, thank you.

1
  • We need code in order to help you. Commented Oct 31, 2018 at 5:18

1 Answer 1

5

You are not in position to call functions in .NET core from .NET framework. Rather, I recomment that for the functions and classes shared between both of your projects, you write them in a library in .NET Standard. This will be accessible from both the .NET framework projects and .NET core projects.

For more information about NET architectural components (.NET standard, core and framework), kindly visit https://learn.microsoft.com/en-us/dotnet/standard/components

Thank you

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

2 Comments

Not necessarily, it can be not only be a desktop project but also be a console app, website, web API, Class Library, e.t.c
Kindly visit [infocodify.com/csharp/csharp_applications] for a full list of applications

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.