Razorlight: Error due to NamespaceDirective use on .NET Core 3.0

Created on 24 Sep 2019  路  5Comments  路  Source: toddams/RazorLight

Describe the bug
Got error on .NET Core 3.0:

Could not load type 'Microsoft.AspNetCore.Mvc.Razor.Extensions.NamespaceDirective' from assembly 'Microsoft.AspNetCore.Mvc.Razor.Extensions, Version=3.0.0.0,

To Reproduce
Try using RazorLight on .NET Core 3.0 project

Information (please complete the following information):

  • OS: Windows
  • Platform .NET Core 3.0 ()
  • RazorLight version 2.0-beta1

It looks like NameSpace directive has been removed in 3.x (https://github.com/aspnet/AspNetCore/issues/7146) but RazorLight uses it here:

https://github.com/toddams/RazorLight/blob/ff6f6f7e32e30f9b0af0475a66d28db4da6eb7ae/src/RazorLight/DefaultRazorEngine.cs#L20

Most helpful comment

You're right, it looks like they didn't remove it. I will close it in favor of https://github.com/toddams/RazorLight/issues/267

All 5 comments

Is this project active? The beta version has been in beta for a long time.
Need this addressed to continue with our upgrade to .NET Core 3.0
eta?

Just come across this issue on macOS.

@Hubert-Rybak Are you sure NamespaceDirective is removed? https://github.com/aspnet/AspNetCore-Tooling/pull/299 says otherwise.

You're right, it looks like they didn't remove it. I will close it in favor of https://github.com/toddams/RazorLight/issues/267

Thanks for your expedient reply

Was this page helpful?
0 / 5 - 0 ratings