3
votes

I wonder if I can use an "old" .NET 4.5.x DLL, which depends on System.Web.Mvc v4.0.0.0 in an aspnet5 (MVC6) project. I have an external library with lots of Html helpers that I would like to use. Is this at all possible?

I try referencing the DLL, but I get the following compiler error, which makes sense:

CS0012 The type 'HtmlHelper' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

Is there any way to do this?

1
I'm guessing it will be less work to update the HTML helpers to use the newer libraries than to try and figure out how to integrate two versions of MVC together.Jeff Siver
If it were my HTML helpers, I definitely would. But I'm not rewriting someone else's library from decompiled source (not Open Source) to support aspnet5 in their library :).Erik A. Brandstadmoen

1 Answers

3
votes

According to Damien Edwards on the ASP.NET team, this is not possible, since the underlying types have changed, not just the namespaces.

(Twitter is the source of all the best aspnet5 knowledge, it's moving so fast...):

https://twitter.com/erikbra/status/575369567549132801