Using framework assembly 2.0 in a WebApi project in version 4.5

I have a "main" assembly with all the logic, and it uses a third-party component written in version 2.0. When I try to start a WebApi (4.0) (4.5) project that provides basic functions, I get the following error:

Failed to load file or assembly "Core" or one of its dependencies. An attempt was made to download a program with the wrong format.

I created a test console application and changed the startup tag in app.config to use an outdated runtime, it works.

<startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> 

What is the corresponding change in the web.config file?

+4
source share
1 answer

This seems like a common problem when creating the wrong architecture. Check out this answer .

+1
source

Source: https://habr.com/ru/post/1484903/


All Articles