0

We have a deployed Razor project on our IIS server. We also have a separate DLL project used by a desktop based application. There is functionality in the DLL that we would like to call from our Razor web site. Is this possible given that the Razor web site is .Net 6 and the class library is .Net framework 4.7.2?

GCDevOps
  • 45
  • 6

1 Answers1

6

No, it's not possible. What you might be able to do is change your class library to target .NET Standard 2.0, and then your .NET Framework 4.7.2 app and your .NET 6 app should both be able to reference it.

Some more details on .NET Standard compatibility here: https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0

Luke
  • 743
  • 6
  • 20
  • Luke. Thanks for your answer. In VS Studio 2019 IDE > project properties > Target framework, there isn't a choice for .Net Standard 2.0. In reading the documentation via the link you provided, there is a section "Select .NET Standard version". I click the 2.0 column and according to the chart, my one project in 2019 which uses the .NET Framework 4.7.2 is supported. So, when you and others say/write "target .NET Standard 2.0", I'm having trouble understanding/visualizing what you mean, EXACTLY. – GCDevOps Aug 20 '22 at 18:32
  • @GCDevOps You're in the right place, but it seems like the option was removed from VS when newer .NET SDKs were installed (among other potential causes). Easiest workaround IMO is editing your project file manually (see https://stackoverflow.com/a/70804108/6621862). – Luke Aug 21 '22 at 12:10
  • thanks for the recent link! Most helpful (and nice to know I'm not the only one questioning the ability to read/comprehend LOL). – GCDevOps Aug 23 '22 at 17:38
  • Happy to help :) odd that they removed that from the list! – Luke Aug 23 '22 at 18:24