❔ Exception trying to run code from a .NET Framework 4.5.2 on .NET 6 project
Hi,
I have a new project using .NET 6, but I need to call a method in a project using .NET Framework 4.5.2. Per company policies I don't have rights to upgrade this project, so I have to use it as it is.
When trying to call a method from this old project, I keep getting this runtime exception:
Been trying to search for a solution, but no luck so far.
Thanks!
5 Replies
I would suggest binding redirects but it doesn't supported in .net 6 I believe
the problem is that this project is using ASP.NET 4.x
i presume you are trying to use it with an ASP.NET Core project
they are not compatible out of the box, which is why you are getting this error
to (attempt to) fix this, you should take a look at https://learn.microsoft.com/en-us/aspnet/core/migration/inc/adapters?view=aspnetcore-7.0
it implements many (but not all) of the ASP.NET 4.x methods for use with ASP.NET Core to ease migration
so,
HttpRuntime
would "just work"
though, it's possible that something else ends up not workingWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.