This is a migrated thread and some comments may be shown as answers.

ToDataSourceResult: Can't load 'Microsoft.AspNetCore.Mvc.Abstractions`

1 Answer 7 Views
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 05 Dec 2019, 01:47 AM

I am attempting to invoke the Kendo mvc extensions from an automated test.

It builds fine, but at runtime I get an exception when I invoke Kendo.Mvc.Extensions.QueryableExtensions.ToDataSourceResult(...)

 

DataSourceRequest request = CreateDefaultDataSourceRequest();
var dataSourceResult = widgets.ToDataSourceResult(request);  // Exception thrown here

 

The exception is:

System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.AspNetCore.Mvc.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
   at Kendo.Mvc.Extensions.QueryableExtensions.ToDataSourceResult

 

I am running this in both .NET Framework 4.6.2 and .NET Core 3.0. It works fine in .NET Framework, it's just the .NET Core build which fails.

 

Here is the complete .csproj file:

<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFrameworks>net462;netcoreapp3.0</TargetFrameworks>
    </PropertyGroup>
 
    <ItemGroup>
      <PackageReference Include="NUnit" Version="3.12.0" />
    </ItemGroup>
    <ItemGroup>
        <ProjectReference Include="..\DATMedia.Core\DATMedia.Core.csproj" />
    </ItemGroup>
 
    <ItemGroup Condition="'$(TargetFramework)' == 'net462'">
        <PackageReference Include="Telerik.UI.for.AspNet.Mvc5" Version="2019.3.1023" />
    </ItemGroup>
 
    <ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
        <PackageReference Include="Telerik.UI.for.AspNet.Core" Version="2019.3.1023" />
    </ItemGroup>
 
    <!-- Some Googling suggested this would help, but nope.-->
    <ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
        <FrameworkReference Include="Microsoft.AspNetCore.App" />
    </ItemGroup>
 
</Project>

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 09 Dec 2019, 03:41 PM

Hello,

I have tested the issue in a simple project but could not observe the described behavior.

I am attaching it here - would you please try to modify it so we could observe the issue and be more helpful with a possible solution.

Regards,
Plamen
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Asked by
Andrew
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or