Skip to content

Commit

Permalink
Fix error when vc_redist is missing (#3293)
Browse files Browse the repository at this point in the history
* Update MainService.cs

* Update src/Neo.CLI/CLI/MainService.cs

---------

Co-authored-by: Jimmy <[email protected]>
  • Loading branch information
chenzhitong and Jim8y committed Jun 7, 2024
1 parent 6e8c730 commit 38cc0e9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Neo.CLI/CLI/MainService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,18 @@ public async void Start(CommandLineOptions options)
ProtocolSettings protocol = ProtocolSettings.Load("config.json");
CustomProtocolSettings(options, protocol);
CustomApplicationSettings(options, Settings.Default);
NeoSystem = new NeoSystem(protocol, Settings.Default.Storage.Engine, string.Format(Settings.Default.Storage.Path, protocol.Network.ToString("X8")));
try
{
NeoSystem = new NeoSystem(protocol, Settings.Default.Storage.Engine, string.Format(Settings.Default.Storage.Path, protocol.Network.ToString("X8")));
}
catch (DllNotFoundException)
{
ConsoleHelper.Error("DLL not found, please install Microsoft Visual C++ Redistributable." + Environment.NewLine +
"See https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist" + Environment.NewLine +
"Press any key to exit.");
Console.ReadKey();
Environment.Exit(-1);
}
NeoSystem.AddService(this);

LocalNode = NeoSystem.LocalNode.Ask<LocalNode>(new LocalNode.GetInstance()).Result;
Expand Down

0 comments on commit 38cc0e9

Please sign in to comment.