Missing using directive or assembly reference???

1 Answer 5443 Views
General Discussions
Shrinand
Top achievements
Rank 1
Shrinand asked on 07 May 2017, 06:14 AM

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?}");
            });
        }
    }
}
Francis
Top achievements
Rank 1
commented on 07 May 2017, 04:47 PM

I think you need to put 
app.UseKendo(env);
after
app.UseMVC();

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 10 May 2017, 12:28 PM

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.
Tags
General Discussions
Asked by
Shrinand
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or