-
Notifications
You must be signed in to change notification settings - Fork 577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not compatible with Microsoft.AspNetCore.Razor 2.0.0 #486
Comments
/cc @conniey |
While this is not resolved, I'm leaving this workaround if someone needs it. I was able to keep RazorEngine working on my app after upgrading to aspnet core 2.0 by using ILMerge-GUI + ILRepack to merge and internalize it's dependencies: Just remove the nuget reference and add the reference to the new file instead. Not perfect, but prevented me from downgrading a dozen projects due to a single dependency. |
It seems that a breaking changes had made. Would it work when you include Microsoft.AspNetCore.Razor, Microsoft.AspNetCore.Razor.Runtime and |
I've tried adding those 2 extra packages, but still getting this error:
with RazorEngine 4.5.1-alpha001 |
We also have some problem. Will it be fixed soon? |
@daviatorstorm Hi, the reason you are getting that issue is because an ASP.NET Core application (netcoreapp2.0) does not support System.Configuration. If you used a full Framework ASP.NET application, it would resolve correctly. |
@conniey I don't have a standalone repo, but will describe my use case a bit more:
Now the issue is that between 1.x and 2.x, most classes were removed from This causes a typeload exception at runtime. I fixed the issue by pinning |
@0x53A Thanks for explaining the issue! I asked the ASP.NET team and when we move to .NET Core, I'll have to add those extra dependencies they mention here: aspnet/Razor#1855 (comment) Your current workaround is what I applied to #488 for now. |
@matthid Any chance we can get a new release with this support? |
@nvivo hey, I had looked into this when it was first mentioned. However, they've upgraded, deprecated, and made internal many classes that RazorEngine uses. So it'll be a huge undertaking. I can look into it more over the weekend but no promises. |
Sorry, I didn't read all the PR, just saw it closed this one. My fault. |
Microsoft.AspNetCore.Razor 2.0.0 only contains a netstandard2.0 dll with a few types:
This obviously causes RazorEngine to crash.
I would suggest to change the reference to 1.0 <= x < 2.0 and/or inquire with the asp.net team if this was on purpose and where the types moved.
The text was updated successfully, but these errors were encountered: