Closed RedX2501 closed 4 years ago
I am just curious - if you load the Assembly via deps.json, do you still get the same problem? I've been meaning to more carefully understand .NET Core assembly loading.
I'm sorry but deps.json files are for core projects. I don't think .Net framework has any support for it.
I haven't looked into this but have you thought about upgrading to .NET Core 3.0 https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework
A bit of a hack, but if you stand up RazorLight as a web server, you can talk to it from your WPF app that way.
I need to still investigate this.
As an update here: I think the issues is that while .netstandard2.0 technically supports "legacy .NET Framework" e.g. #if NETFRAMEWORK
, ASP.NET Core does not. As such, there are no assemblies directly available to link against safely. Recommendation remains to spin up a separate dotnet.exe
.NET Core process and use IPC instead. You can build a simple IPC messaging protocol on top of Octopus Deploy's Halibut runtime.
Using latest master (60fdee0b937233d201f8c57410e6ee5a02b2dffc).
When using RazorLight from an assembly loaded via Assembly.LoadFile the following error is raised:
I have created a sample project with which the problem can be reproduced. It is a WPF .NET Framework 4.7.2 application that loads a .NET Standard 2.0 assembly that uses RazorLight. See class
SomeViewModel.cs
for the loading and calling of the plugin.RarzorLightAsPlugin.zip