I have web service that writing in C# , and host in azure .
As part of my processing I want to use the fire-base admin via my C# code.
After I looking in the web I found the edge.js package that let you to run node.js scripts under C# , I install the package and success to run different node.js scripts via C# .
The problem start when I try to use the firebase admin SDK .
I install the firebase lib via npm (npm install firebase-admin -g) as global package.
Then I try to use it for calling the firebase lib , I try only to load the lib and I received error.
var func = Edge.Func(@"
return function(data,callback)
{
var admin = require('firebase - admin');
callback(null, 'test fcm ' + data);
}
");
The error I received in c# is :
An unhandled exception of type 'System.AggregateException' occurred in mscorlib.dll
So I have several question : 1. May someone success to work with the fire-base lib via edge.js ?
How I can debug the error ?
May someone have different method for calling the firebase admin nodejs sdk via C# ?
May someone have any method for calling the firebase admin via C# code ?
Thanks , MAK
To avoid this error, you'd need to run the command
npm install firebase-adminin the root of your c# project, it will install the dependencies in thenode_modulesfolder for your project.You also need to remove spaces from the package name as below: