Missing using directive or assembly reference???

3 posts, 0 answers
  1. Shrinand
    Shrinand avatar
    15 posts
    Member since:
    Oct 2010

    Posted 07 May 2017 Link to this post

    Hi, I set up a project which I build and run fine on Windows. When I bring it over to ubuntu and try to build, I have these errors

     

    error CS1061: 'IServiceCollection' does not contain a definition for 'AddKendo' and no extension method 'AddKendo' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) 

    error CS1061: 'IApplicationBuilder' does not contain a definition for 'UseKendo' and no extension method 'UseKendo' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?) 

     

    csproj file

    <Project Sdk="Microsoft.NET.Sdk.Web">
      <PropertyGroup>
        <TargetFramework>netcoreapp1.1</TargetFramework>
      </PropertyGroup>
      <ItemGroup>
        <PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
        <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
        <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
        <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
        <PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.0" />
        <PackageReference Include="Telerik.UI.for.AspNet.Core" Version="2017.2.504" />
      </ItemGroup>
    </Project>

     

    Startup.cs

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using Microsoft.AspNetCore.Builder;
    using Microsoft.AspNetCore.Hosting;
    using Microsoft.Extensions.Configuration;
    using Microsoft.Extensions.DependencyInjection;
    using Microsoft.Extensions.Logging;
     
    namespace TelerikAspNetCore
    {
        public class Startup
        {
            public Startup(IHostingEnvironment env)
            {
                var builder = new ConfigurationBuilder()
                    .SetBasePath(env.ContentRootPath)
                    .AddEnvironmentVariables();
                Configuration = builder.Build();
            }
     
            public IConfigurationRoot Configuration { get; }
     
            // This method gets called by the runtime. Use this method to add services to the container.
            public void ConfigureServices(IServiceCollection services)
            {
                // Add framework services.
                services.AddMvc();
                services.AddKendo();
            }
     
            // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
            public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
            {
                app.UseDeveloperExceptionPage();
     
                app.UseStaticFiles();
                app.UseKendo(env);
     
                app.UseMvc(routes =>
                {
                    routes.MapRoute(
                        name: "default",
                        template: "{controller=Home}/{action=Index}/{id?}");
                });
            }
        }
    }
  2. Francis
    Francis avatar
    20 posts
    Member since:
    Feb 2011

    Posted 07 May 2017 Link to this post

    I think you need to put 
    app.UseKendo(env);
    after
    app.UseMVC();
  3. Ianko
    Admin
    Ianko avatar
    1945 posts

    Posted 10 May 2017 Link to this post

    Hello Francis,

     

    For running UI for ASP.NET Core under Linux OS you can refer to this help article: http://docs.telerik.com/aspnet-core/getting-started/getting-started-linux and see if you are missing something from the initial setup.  

     

    Also, make sure that the Telerik.UI.for.AspNet.Core package is restored properly and available in the NuGet cache folder for the app to be able to be built.

     

    Regards,
    Ianko
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top