Kendo-ui-core: Fix Kendo UI scaffolder hijacks "Add Controller"

Created on 2 Nov 2016  路  8Comments  路  Source: telerik/kendo-ui-core

Bug report

When the developer picks Add | Controller in VS2015 he/she gets the Kendo UI Scaffolder dialog instead of the default VS add new controller dialog. This is a problem because the developer is unable to add a new empty controller.
The issue is reproducible only in Telerik ASP.NET Core projects and not in Telerik ASP.NET MVC ones.

Reproduction of the problem

Video reproduction in Telerik ASP.NET Core project -> http://screencast.com/t/iB1e9gPA1iX

Current behavior

It is impossible to add an empty controller

Expected/desired behavior

It should be possible to add an empty controller

Environment

  • UI for ASP.NET MVC Core: 2016.3.xxx
    Visual Studio 2015
Won't Fix

Most helpful comment

This one just threw me off again. With .net core apps, you need to make sure you have the dependencies in your project.json for the new Controller option to appear in VS. It's some combination of the below:
{
"dependencies": {
...
"Microsoft.AspNetCore.Mvc": "1.1.1",
...
"Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.1.0-preview4-final",
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": "1.1.0-preview4-final"
},

"tools": {
...
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.1.0-preview4-final",
"imports": [
"portable-net45+win8+wp8+wpa81"
]
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8+wp8+wpa81"
]
}
},
After those are there, the menu prompts correctly:
2017-03-01 09_40_28-add scaffold

All 8 comments

Any update on this? Still happening.

Hi,

I'm raising the severity of the public issue to critical so its priority in our issues backlog will also be increased.

Best Regards

It was false report in the first place. Visual Studio itself don't have "Controller..." into the context menu. So we are not overriding anything.
Without Scaffolder:
originalmenu
With Scaffolder:
scaffoldermenu

Nice catch! Perhaps we can register our entry as "Kendo UI Controller..."?

Looking at the values of CodeGeneratorInformation it looks as the text in the menu is not something that we can control.

We set the correct Categories and Gestures, which tells Visual Studio that a Controller and/or View can be created using our Scaffolder.

If the user have several extensions, he will see this window(which is not ours):
image
But if he don't have multiple extensions the studio itself starts the only one available.

http://stackoverflow.com/questions/32901637/add-controller-option-is-missing-in-visual-studio-2015

Here are some discussions about missing the add controller in non-telerik VS 2015

This one just threw me off again. With .net core apps, you need to make sure you have the dependencies in your project.json for the new Controller option to appear in VS. It's some combination of the below:
{
"dependencies": {
...
"Microsoft.AspNetCore.Mvc": "1.1.1",
...
"Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
"Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.1.0-preview4-final",
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": "1.1.0-preview4-final"
},

"tools": {
...
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.1.0-preview4-final",
"imports": [
"portable-net45+win8+wp8+wpa81"
]
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8+wp8+wpa81"
]
}
},
After those are there, the menu prompts correctly:
2017-03-01 09_40_28-add scaffold

@brentkilboy that did it!

The only catch was that Microsoft.EntityFrameworkCore.Tools needed to be loaded with the console and with the -pre switch.

https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Tools/1.1.0-preview4-final

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andreluizbellon picture andreluizbellon  路  5Comments

IvanDanchev picture IvanDanchev  路  4Comments

gyoshev picture gyoshev  路  4Comments

simonssspirit picture simonssspirit  路  3Comments

CSP
aersamkull picture aersamkull  路  4Comments