Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Non-ASP.NET apps - default project path #1100

Closed
coosmiin opened this issue Jul 10, 2017 · 0 comments
Closed

Non-ASP.NET apps - default project path #1100

coosmiin opened this issue Jul 10, 2017 · 0 comments

Comments

@coosmiin
Copy link

coosmiin commented Jul 10, 2017

When trying to use the services in a non-ASP.NET app, I had to set the ProjectPath option to current directory in order to make it work:

var services = new ServiceCollection();
services.AddNodeServices(options => {
	options.ProjectPath = Directory.GetCurrentDirectory();
});
IServiceProvider serviceProvider = services.BuildServiceProvider();
var nodeServices = serviceProvider.GetRequiredService<INodeServices>();
var result = await nodeServices.InvokeAsync<int>("addNumbers", 1, 2);

I would expect the ProjectPath to be set by default to current directory, or, at least to make it clear in the documentation that you need to specify the ProjectPath correctly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant