Kendo-ui-core: Not compiling MVC project if Telerik.UI.for.AspNet.Mvc5 is included from NuGet and project's MvcBuildViews setting is true

Created on 24 Nov 2017  路  7Comments  路  Source: telerik/kendo-ui-core

Bug report

Could not load type 'System.Web.Mvc.ViewUserControl'

Reproduction of the problem

  1. VS2015 > File > New > Project
  2. Select: 'ASP.NET Web Application (.NET Framework)'
  3. Select: 'MVC' Template
  4. Right Click Project > Select 'Manage NuGet Packages'
  5. Package Source > Select 'telerik.com' and enter credentials
  6. Switch to Browse Tab and Search 'MVC5'.
  7. Select 'Telerik.UI.for.AspNet.Mvc5'
  8. Install 2017.3.1026
  9. After package install, Right click project > Select 'Unload Project'
  10. Right click unloaded project > Select Edit Project
  11. Edit node: '/Project/PropertyGroup/MvcBuildViews' value = 'true'
  12. Save, Close window
  13. Right Click project > Select 'Reload Project'
  14. Build project

Current behavior

Every ascx control supplied by Telerik in /Content/kendo/2017.3.1116/ascx fails to compile:
_Could not load type 'System.Web.Mvc.ViewUserControl'_

Expected/desired behavior

The project compiles, as it compiles properly, when '/Project/PropertyGroup/MvcBuildViews' value = 'false'

Environment

  • Kendo UI version: 2017.3.1026
Bug Wrappers (ASP.NET MVC) High Won't Fix jQuery1 jQuery2

Most helpful comment

The editor template are there as like @matanasov said, grid component editing feature relies on them. Otherwise, client will end up with Grid with only plain input[type=text] elements and will open a support ticket to ask where the "normal" editors are.

All 7 comments

We should also check the AspNet.Mvc3 and AspNet.Mvc4 packages as well as the trial packages for MVC 3, 4 and 5.

@ag-petrov fixed it by removing EditorTemplates from the nuget packages. However components that rely on them (Grid for examples) wouldn't be able to use these templates from the nuget package. This way clients using the MVC installer will get the templates, but clients using Nuget packages will not.

@ivanchev @hadjieva Could you please provide your opinion and approve this fix?

I wouldn't say. Let's try to fix the issue while preserving the availability of the templates.

Personally, I think that the nuget package should only contain binaries, scripts and styles. The editors seem like delivering custom logic through nuget. Maybe @tsvetomir or @rkonstantinov can share why were the editors included in the first place.

The editor template are there as like @matanasov said, grid component editing feature relies on them. Otherwise, client will end up with Grid with only plain input[type=text] elements and will open a support ticket to ask where the "normal" editors are.

I also think that the Editor template should be preserved, otherwise it would be a breaking change. Let's try to fix the MVC project compiling in a different way.

After a discussion we decided not to alter the current behavior as this may affect how the editors are distributed which will be a breaking change.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

simonssspirit picture simonssspirit  路  3Comments

VicTachev picture VicTachev  路  5Comments

CSP
aersamkull picture aersamkull  路  4Comments

PreslavKozovski picture PreslavKozovski  路  3Comments

ipeshev picture ipeshev  路  4Comments