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

Upgraded to 2020 and now I cannot publish to Azure

9 Answers 160 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 23 Oct 2020, 02:25 PM

Hi,

I upgraded to 2020 of the Telerik ASP.NET MVC UI and using the Grid control Export to Excel feature in my cloud application.  During upgrade,Telerik required me to upgrade my System.Web.Mvc reference to a newer version, which I did.  My web application is working fine on my local system, but now when I'm trying to publish the project to Azure I get the following error in my preview...

 

Could not load type 'System.Web.Mvc.ViewUserControl<DateTime?>'.

 

And I am not able to publish.  

 

Any ideas on what is causing this and what I need to fix to publish my project to Azure?

Thanks,

Shawn

 

9 Answers, 1 is accepted

Sort by
0
Aleksandar
Telerik team
answered on 27 Oct 2020, 12:50 PM

Hi Shawn,

This seems like an assembly reference error. Check the following link for details and this SO thread for possible approaches to resolving the issue.

Regards,
Aleksandar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Shawn
Top achievements
Rank 1
answered on 27 Oct 2020, 02:19 PM

Aleksandar,

Thank you for getting back to me, however, those links do not address my issue.  My application works fine when running locally in my development environment after upgrading to 2020 of the Telerik ASP.NET MVC 2020 version.  I needed to do this to get the Export to Excel support working for the grids I use.  During this process, I was required to upgrade to Telerik.UI.for.AspNet.Mvc5 which required the Microsoft.AspNet.Mvc to be upgraded to 5.2.7.  This all went fine and my web application runs and I have the Export to Excel working.  I'm only getting the error when I try and publish the project to Azure.

Searching for the particular error from the publish, it refers to System.Web.Mvc.ViewUserControl<DateTime?>

Searching through the entire solution, the only place that I find a reference to this is in an .ascx file under the \Content\Kendo\2020.3.1021\ascx folder.  There are 2 files here, Date.ascx and DateTime.ascx.  The content of DateTime.ascx file is:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DateTime?>" %>
<%: Html.Kendo().DateTimePickerFor(m => m) %>

 

I am assuming that is is the file causing the publish issue and I would like to know how it can be fixed?  I tried running the Telerik UI for ASP.NET MVC Upgrade Wizard which took a long time but completed successfully.  And as I said above, everything works fine locally, so the references should be correct.  

Thanks,

Shawn

0
Shawn
Top achievements
Rank 1
answered on 28 Oct 2020, 11:42 AM

Just an update...

I reverted to the backup copy that was made during the Telerik Upgrade Wizard process and that project published fine.  So something during that Upgrade Wizard process must have changed something that impacted the publish process.

Anyway, I have published up toe Azure and now have the Export to Excel working in the grids.

0
Aleksandar
Telerik team
answered on 29 Oct 2020, 01:19 PM

Hello Shawn,

I am glad to hear you were able to publish your application, however, if I understand correctly you were not able to publish it with the updated version of Telerik UI for ASP.NET MVC. 

Can you share some additional details on the scenario you have? From which version are you updating? Do you have the EditorTemplates folder in the application? Did you update both the web.config files, as suggested in this SO thread? You can also check the csproj file on whether the MVCBuildViews property is set to false:

<PropertyGroup>
...
    <MvcBuildViews>false</MvcBuildViews>
...
  </PropertyGroup>

Let me know any of the above suggestions help resolve the issue when updating the Telerik UI for ASP.NET MVC.

Regards,
Aleksandar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Shawn
Top achievements
Rank 1
answered on 29 Oct 2020, 06:05 PM

Aleksandar,

No.  I was able to publish my web application to Azure with the Telerik 2020 version of the UI for ASP.NET MVC.  Everything is working fine now.

When I initially upgraded to 2020 in my project, I had to make several changes to the code to get it to work.  As you mentioned, the web.config and the _layout.cshtml files.  I then noticed in Visual Studio 2015 that, when right clicking on the solution in the Solution Explorer, there was an option for 'Telerik UI for ASP.NET MVC and this contained an option for an Upgrade Wizard.  The tooltip suggests that it updates all the necessary files/references throughout the solution, so I ran it.  I suggested creating a backup before continuing which it did.  After this, I could run locally, but when I went to publish it failed.  After wasting a day of Google searching and finding old articles that didn't work and one that completely killed my references, I ended up reverting back to the backed up copy of the project before the Upgrade Wizard ran, added in the few changes I needed to make and tested in my local environment.  All was good.  Then I was able to successfully publish the project to Azure.

So I am not sure what the Upgrade Wizard did to the code, but it appears that it made changes that impacted the publishing process.  What I noticed was that under the Content folder, the upgrade contains an ascx folder and the files in this folder were the ones throwing errors.

Regards,

Shawn

0
Aleksandar
Telerik team
answered on 02 Nov 2020, 02:37 PM

Hi Shawn,

Thank you for the additional details. 

You mention you update the web.config and _layout.cshtml files. Is my understanding correct that both web.config files were updated:

as both files would contain references to the System.Web.Mvc assembly. 

Regards,
Aleksandar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Shawn
Top achievements
Rank 1
answered on 02 Nov 2020, 03:36 PM

Yes.  The web.config files in both locations were updated manually and the _layout.cshtml.

 

But I also ran the following wizard as I thought there may be other areas in my project that might need updates.  See attached image.

Running this wizard is what seems to have caused the publishing problem.  It seems to add a lot of Telerik files under the Content folder (*.ascx files) and these through the errors during publishing.

 

Reverting back to just the web.config and _layout.cshtml changes, the publish worked.

 

0
Aleksandar
Telerik team
answered on 04 Nov 2020, 02:14 PM

Hi Shawn,

Thanks for confirming. I am afraid, however, I am still having issues reproducing the issue reported. Is it possible to provide a stripped-down version of the project where this can be observed? This way I will be able to test and debug further to investigate what is causing the issue.

Regards,
Aleksandar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Shawn
Top achievements
Rank 1
answered on 04 Nov 2020, 02:33 PM

Aleksandar,

This is no longer an issue for me.  I am able to publish my project to Azure, so no need to try and reproduce this.

Kind regards,

Shawn

Tags
General Discussions
Asked by
Shawn
Top achievements
Rank 1
Answers by
Aleksandar
Telerik team
Shawn
Top achievements
Rank 1
Share this question
or