Cannot use kendo ui with cassette sets in asp.net mvc

I created this kit:

bundles.Add<ScriptBundle>("kendo-autocomplete", new string[] {
    "~/Scripts/Kendo/kendo.core.min.js",
    "~/Scripts/Kendo/kendo.aspnetmvc.min.js",
    "~/Scripts/Kendo/kendo.data.min.js",
    "~/Scripts/Kendo/kendo.list.min.js",
    "~/Scripts/Kendo/kendo.popup.min.js",
    "~/Scripts/Kendo/kendo.autocomplete.min.js"});

When debug is true, everything works fine, and I can create an instance of Kendo UI Autocomplete, but when debug is false, I get this error:

TypeError: jQuery (...). kendoAutoComplete is not a function

I have already redefined IConfiguration, but nothing has changed.

public class CustomCassetteServices : IConfiguration<TinyIoCContainer>
{
    public void Configure(TinyIoCContainer container)
    {
        var settings = new Microsoft.Ajax.Utilities.CodeSettings();
        settings.MinifyCode = true;
        settings.PreserveFunctionNames = true;
        settings.RemoveFunctionExpressionNames = false;
        settings.RemoveUnneededCode = true;
        settings.IgnoreAllErrors = true;
        settings.LocalRenaming = LocalRenaming.KeepAll;
        settings.ManualRenamesProperties = false;
        settings.OutputMode = OutputMode.SingleLine;
        settings.StrictMode = false;
        settings.CollapseToLiteral = false;
        container.Register<IJavaScriptMinifier>(new MicrosoftJavaScriptMinifier(settings));
    }
}

How can i fix this?

+4
source share

Source: https://habr.com/ru/post/1544376/


All Articles