Closed filcole closed 1 year ago
The issue here is that Power Fx uses satellite assemblies for resources. Dependent assemblies require those be copied manually.
Here's a technique to get the path: https://patriksvensson.se/posts/2019/09/how-to-find-a-nuget-package-path-from-msbuild
Here's a snippet we used for one of our plugins using power fx:
<ItemGroup>
<!-- Plex requires the satellite resource dll be copied to the output directory.
$(PkgMicrosoft_PowerFx_Core) var is set by GeneratePathProperty=true on the PackageReference. -->
<None Include="$(PkgMicrosoft_PowerFx_Core)\lib\netstandard2.0\en-US\Microsoft.PowerFx.Core.resources.dll" Link="Microsoft.PowerFx.Core.resources.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
Thanks @MikeStall. Seems to be working great.
Great. curious - what are you working on?
this is not work when use this solution to generate WebAssambly files and call it from Javascript
When including Microsoft.PowerFx.Core and Microsoft.PowerFx.Interpreter in a dataverse plugin via dependent assemblies I get the following error when the plugin is run within Dataverse: (occurs with version 0.2.3-preview)
I get this immediately upon instantiating the engine, e.g.
var engine = new RecalcEngine();
To work around this I had to copy
Microsoft.PowerFx.Core.resources.dll
from the nuget cache to the plugin project folder, and then add the following to the .csprojI think there might be a glitch in the Power Fx nuget packaging, because I can use other packages via dependent assemblies successfully. (e.g. Newtonsoft.Json, YamlDotNet)