This is a migrated thread and some comments may be shown as answers.

Help Upgrading MVC 3 Application to MVC 5

1 Answer 440 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Veteran
Iron
Eric asked on 20 Apr 2020, 07:46 PM

I have a 10 year old ASP.Net MVC 3 application that was originally built using Telerik ASP.Net MVC 3.  I am now trying to upgrade the website to MVC 5, and I believe I have the standard ASP.Net components upgraded, but I am really stuck with the Telerik components.  If I try to run the MVC 5 application with the Telerik MVC 3 components, I get this TypeLoadException.  I made an attempt to upgrade to Telerick MVC 5, but it seems like all of the classes have changed, and as you can imagine, an application that has been in active development for 10 years has a lot of code, and I do not think I can just go and re-write it all to use completely different types for the controls.  What kind of upgrade path can you recommend to get this application to run on MVC 5?  If there is a way to just overcome this TypeLoadException with the Telerik MVC 3 components or to upgrade to Telerik MVC 5 without having to rewrite the entire application, that would be great.  Thank you.

 

System.TypeLoadException: Inheritance security rules violated by type: 'Telerik.Web.Mvc.PopulateSiteMapAttribute'. Derived types must either match the security accessibility of the base type or be less accessible.

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 22 Apr 2020, 03:12 PM

Hello Eric,

As of June 2013, Telerik Extensions for ASP.NET MVC has reached its official End of Life (EOL) and we no longer provide support for it. The product has been replaced by Telerik UI for ASP.NET MVC.

The discontinued Telerik Extensions was designed to work on MVC 1, 2, and 3. It was/is not compatible with MVC 5 applications, whereas UI for ASP.NET MVC supports MVC 5. So when it comes to MVC 5, UI for ASP.NET MVC is the only option of the two that will work.

We don't have a tool that does automatic migration from Telerik Extensions to UI for ASP.NET MVC, so the migration needs to be done manually.

The following exemplary Grid declaration demonstrates some key syntax differences:

Extensions:

@(Html.Telerik().Grid<Product>()
    .Name("Grid")
    .DataBinding(dataBinding => dataBinding
        .Ajax()
            .Select("AjaxBinding_Read", "Grid")
    )
)

UI for ASP.NET MVC:

@(Html.Kendo().Grid<Product>()
    .Name("Grid")
    .DataSource(dataSource => dataSource
        .Ajax()
            .Read(read => read.Action("AjaxBinding_Read", "Grid"))
    )
)

However, this is just a very basic example. The UI for ASP.NET MVC suite has evolved substantially over the years, thus migrating would essentially mean re-writing the application with the new UI suite.

The following articles and the related ones in them will get you started with UI for ASP.NET MVC:

Regards,
Ivan Danchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
Eric
Top achievements
Rank 1
Veteran
Iron
Answers by
Ivan Danchev
Telerik team
Share this question
or