1

I am creating a fresh ASP.net core web API. I have referenced a project DLL in my web API which is again referring to system.web.application.services.dll. The solution is building fine but getting the below exception when I call POST verb from POSTMAN.

Error details:

Could not load file or assembly 'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified

1
  • It is most likely because the dll project type is not compatible with Core. What is the type of your project dll? And if is referencing any packages, then what is the type for each of those packages? Commented Dec 12, 2017 at 18:30

1 Answer 1

2

It sounds like you're referencing a .NET Framework 4.6 (or below) DLL in your .NET Core project. You have two options:

  1. Add a reference to System.Web.ApplicationServices in your project. You may have to browse for the actual DLL (System.Web.ApplicationServices.dll), which you should be able to find in C:\Windows\Microsoft.NET\Framework64\v4.0.30319.
  2. (I think this will work) Change your project to target the full .NET Framework instead of .NET Core.

You might run into other roadblocks after doing this, but it's a step in the right direction.

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

Comments

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.