-
Notifications
You must be signed in to change notification settings - Fork 38
Description
I've been trying these samples on macOS 11.6.1
I am using .Net: 6.0.101
but I get the following error trying the WebDemo and ConsoleREPL:
The type initializer for 'Microsoft.PowerFx.Core.Texl.BuiltinFunctionsCore' threw an exception
To fix the issue, I've locally modified the samples taking inspiration from microsoft/Power-Fx#71 (comment)
ConsoleREPL
To fix the issue I've added:
CultureInfo.CurrentCulture = new CultureInfo("en-US");before this ResetEngine(); line:
power-fx-host-samples/Samples/ConsoleREPL/ConsoleREPL.cs
Lines 27 to 29 in 63ae373
| public static void Main() | |
| { | |
| ResetEngine(); |
Before:
After:
Web
Since I could not find ASP.Net redistributable for .Net Core 3.1 for Mac OS X,
I've replaced this line:
| <Project Sdk="Microsoft.NET.Sdk.Web"> | |
| <PropertyGroup> | |
| <TargetFramework>netcoreapp3.1</TargetFramework> |
to read
<TargetFramework>netcoreapp6.0</TargetFramework>instead.
Then, I've changed this line:
power-fx-host-samples/Samples/WebDemo/service/Model/PowerFxScopeFactory.cs
Lines 16 to 20 in 63ae373
| public RecalcEngine GetEngine() | |
| { | |
| // If the engine requires additional symbols to load, server | |
| // should find a way to safely cache it. | |
| var engine = new RecalcEngine(); |
to read:
public RecalcEngine GetEngine()
{
// If the engine requires additional symbols to load, server
// should find a way to safely cache it.
CultureInfo.CurrentCulture = new CultureInfo("en-US");
var engine = new RecalcEngine();instead.
Please notice I've tried to just pass new CultureInfo("en-US") as an argument to the RecalcEngine constructor, but that didn't solve 🤷
Pardon me if there is a simpler solution but I'm very new to .Net! 😆



