Is there a way to add and start a REST.Net Core 2.0 server in a .NET Framework 4.5.2 application (or .NET Framework 4.6.1 or .Net Standard 2.0)?

Question

Hi, I am currently working on implementing a RESTful API in C # using ASP.net Core 2.0 in Visual Studio 2017 (only works through Kestrel, so there is no IIS).

Everything works very well, no problems. The fact is that now I need to integrate and run this REST server in another project (a REST server is only one of many functions that must be performed simultaneously using "bootstrap"). My problem here is that the latest project is targeting the .NET Framework 4.5.2, while the REST server is targeting .Net Core 2.0. Thus, when I add a REST server to the links of my application to download, I encounter several errors saying that some Nuget packages are targeting the wrong structure.

The solutions I tried

I searched Google, but most of the problems I discovered are people who are trying to do it the other way around, i.e. adding a project with a .NET network to a .NET application.

As I understand it . Net Implementation Support Chart : .Net standard 2.0 project can support .Net Core 2.0 project (I guess I'm wrong). I tried a couple of things to make it work (which, the spoiler alert is obviously and, unfortunately, did not work, as I am not asking for your help):

  • Target application program for converting .Net Standard 2.0
  • Created an application target for converting .Net Framework 4.6.1
  • Created the target server server REST.Net Standard 2.0 (which, of course, did not work, but I was desperate ..)

I made these goal changes by modifying the .csproj files.

I do not have exact error codes, because I returned my changes some time ago, but they all concerned projects that were not intended for the same structure.

So, in my opinion, I ask:

REST.net Core 2.0 REST .NET Framework 4.5.2 ( 4.6.1 /.Net Standard 2.0), ?

, .

, !

+4

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


All Articles